next-fetch icon indicating copy to clipboard operation
next-fetch copied to clipboard

Allow disabling the fetching based on a condition

Open Schniz opened this issue 2 years ago • 0 comments

The SWR API allows users to opt out of fetching by having a null key:

useSWR(() => someCondition ? null : "/my/key", ...)

I think we can support that too with our API. We can accept null and/or a function that resolves into a null/object to allow conditional fetching

Schniz avatar Aug 04 '22 07:08 Schniz