diff --git a/src/utils/cache.ts b/src/utils/cache.ts index cb05a2253..10acf512a 100644 --- a/src/utils/cache.ts +++ b/src/utils/cache.ts @@ -41,20 +41,20 @@ export function initCache( Data > + // Update the state if it's new, or the provider has been extended. + SWRGlobalState.set(provider, [ + EVENT_REVALIDATORS, + {}, + {}, + {}, + {}, + {}, + mutate + ]) + // This is a new provider, we need to initialize it and setup DOM events // listeners for `focus` and `reconnect` actions. if (!IS_SERVER) { - // Update the state if it's new, or the provider has been extended. - SWRGlobalState.set(provider, [ - EVENT_REVALIDATORS, - {}, - {}, - {}, - {}, - {}, - mutate - ]) - opts.initFocus( revalidateAllKeys.bind( UNDEFINED,