Pricing Blog

Autofetch and api parameters

  • ssssadsadasd-1413117208137044009

    ssssadsadasd

    9 days ago

    I have an api with an autofetch. I want autofetch to trigger only when this rule is true.
    however, the api is autofetched even when simply one of the body parameters is changed.
    how to prevent the latter?
  • erikbeus-1413126822966722580

    Erik Beuschau

    9 days ago

  • ssssadsadasd-1413127692034899978

    ssssadsadasd

    9 days ago

    @Erik Beuschau yes i did
    1413127691707875421-image.png
  • ssssadsadasd-1413129593245925399

    ssssadsadasd

    9 days ago

    so I basically want the autofetch to trigger only when the formula is true.
    and not also when one of the parameters changes

    I initially solved this with on load/attribute change of the page, but thought this could be easier and I could make use of ssr
  • erikbeus-1413265404242956390

    Erik Beuschau

    9 days ago

    Ah. I see. You could change the auto fetch formula to only be truthy when it’s evaluated during SSR. There’s a formula called “Is Server” for that I believe
    👍1