Skip to content
Discussion options

You must be logged in to vote

Hello there!

Unfortunately SWR doesn't have a built-in way to handle long-polling. Using refreshInterval: 1 is a good work around indeed.

I think it makes sense to think about a good way to support long-polling in SWR, perhaps with #1263 (but that would still require some code to setup, this is something we need to have in mind when designing this new API). Fundamentally long-polling is something more similar to subscription than fetch: single instance, always connected and deduplicates others.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cameronelliott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants