swr
swr copied to clipboard
Clear Cache Hook
/** Hook for clearing cache */
export const useClearCache = () => {
const { mutate } = useSWRConfig()
const clearCache = () => {
mutate(() => true, undefined, false)
}
return clearCache
}
Plz export this hook directly from SWR so we can keep our codebases cleaner