Continuous requests using useSWR #997
-
Hi! In my use case, I have a bunch of independent requests I need to make at once but I want the data to be usable as soon as it is returned. I've tried making a blast fetcher but that will not return the data until all requests return. I've also tried using useSWRInfinite, but that makes requests happen synchronously. Is there a recommended method of doing this using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The simplest solution is to make each independent request independently; there's no reason you can't call Would that meet your needs? |
Beta Was this translation helpful? Give feedback.
The simplest solution is to make each independent request independently; there's no reason you can't call
useSWR
as many times as you want within a component. The component will re-render with available data as individual requests come in.Would that meet your needs?