On Load API calls?

  • frankenwompus-1309669211232145554

    Fisher

    5 months ago

    I have a page, and On Load I want to set a bunch of things from an api call to variables. I do this several times to account for several different variables to set. My question is: Is this API call happening several times on load, one for each variable set? If so, what is the better way to do this?
    1309669211953434715-image.png
  • lucasg-1309671544360009820

    Lucas G

    5 months ago

    Just the one time
    👍1
  • If you’re doing server-side fetching, set the variants on the success event of the api call instead
  • frankenwompus-1309702395307102270

    Fisher

    5 months ago

    Thanks @Lucas G
  • Tod-1309702396666052609

    Tod

    5 months ago

    Great energy @Fisher! Your continuous contribution to the toddle Community just made you advance to Community Level 6!