Open History to see the last commit
1import { createContext, useContext } from 'octane'
2β
3// IsRestoring β true while a persisted client is being restored from storage. While
4// restoring, queries read the cache but don't subscribe/fetch (they wait for the
5// restore to finish). Defaults to false, so without a provider it's inert.
6const IsRestoringContext = createContext(false)
7β
8export function useIsRestoring(): boolean {
9 return useContext(IsRestoringContext)
10}
11β
12// `<IsRestoringProvider value={true}>β¦` β octane's built-in context Provider.
13export const IsRestoringProvider = IsRestoringContext.Provider