swr icon indicating copy to clipboard operation
swr copied to clipboard

cache on useSWRConfig is delayed

Open vinodhum opened this issue 1 year ago • 2 comments

Bug report

I am trying to access global cache using useSWRConfig and updated cache is delayed by few seconds.

const { cache } = useSWRConfig is there any other way to subscribe to global cache ?

Description / Observed Behavior

What kind of issues did you encounter with SWR?

Expected Behavior

How did you expect SWR to behave here?

Repro Steps / Code Example

Or share your code snippet or a CodeSandbox link is also appreciated!

Additional Context

SWR version. Add any other context about the problem here.

vinodhum avatar Dec 19 '24 14:12 vinodhum

quick update looks like cache is updated, after rerender only

vinodhum avatar Dec 19 '24 16:12 vinodhum