You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking through the source code but couldn't find the code where it calls the unsubscribe function that's returned in initFocus . It seems like it will never be called.
This is not a blocking issue, just an inconsistency in the docs/code.
Expected Behavior
It should call the function that's returned from initFocus() when unmounting the provider (SWRConfig).
OR
it should call the function that's returned from initFocus() when there are no active useSWR() hooks.
Bug report
Description / Observed Behavior
I was looking through the source code but couldn't find the code where it calls the unsubscribe function that's returned in
initFocus
. It seems like it will never be called.This is not a blocking issue, just an inconsistency in the docs/code.
Expected Behavior
It should call the function that's returned from
initFocus()
when unmounting the provider (SWRConfig).OR
it should call the function that's returned from
initFocus()
when there are no activeuseSWR()
hooks.Repro Steps / Code Example
Derived from https://swr.vercel.app/docs/advanced/react-native#global-setup
Additional Context
SWR version 1
Relevant code:
swr/src/utils/cache.ts
Lines 57 to 58 in 3285cc4
Mentioned in #417 (comment)
The text was updated successfully, but these errors were encountered: