Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Allow disabling the fetching based on a condition #11

Open
Schniz opened this issue Aug 4, 2022 · 0 comments
Open

Allow disabling the fetching based on a condition #11

Schniz opened this issue Aug 4, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Schniz
Copy link
Collaborator

Schniz commented Aug 4, 2022

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 Schniz added the enhancement New feature or request label Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant