BetterTyped/hyper-fetch

The `disabled` option for `useFetch` ignored

lmartins opened this issue · 1 comments

Describe the bug
I was expecting to halt the query until the expression would evaluate true. Instead the fetch appears to always run, no matter what I pass to this param.

To Reproduce

const { data, error, loading } = useFetch(getSpeaker.setParams({ speaker: el.dataset.speaker }), {
    disabled: !showDrawer,
    refetchOnFocus: false,
});

Expected behavior
I was expecting this to behave similarly to react-query, where the fetch will only happen once disabled evaluates to true. Is that a fair assumption?

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome

Additional context
Add any other context about the problem here.

Apologies, I mixed up something on my codebase and this is indeed working as assumed. I was just looking at the wrong place.