File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
query-persist-client-core/src Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ export { QueryClient } from './queryClient'
2020export { QueryObserver } from './queryObserver'
2121export { CancelledError , isCancelledError } from './retryer'
2222export {
23- systemSetTimeoutZero ,
2423 timeoutManager ,
2524 type ManagedTimerId ,
2625 type TimeoutCallback ,
Original file line number Diff line number Diff line change 11import {
22 hashKey ,
33 matchQuery ,
4+ notifyManager ,
45 partialMatchKey ,
5- systemSetTimeoutZero ,
66} from '@tanstack/query-core'
77import type {
88 Query ,
@@ -130,7 +130,9 @@ export function experimental_createQueryPersister<TStorageValue = string>({
130130 } else {
131131 if ( afterRestoreMacroTask ) {
132132 // Just after restoring we want to get fresh data from the server if it's stale
133- systemSetTimeoutZero ( ( ) => afterRestoreMacroTask ( persistedQuery ) )
133+ notifyManager . schedule ( ( ) =>
134+ afterRestoreMacroTask ( persistedQuery ) ,
135+ )
134136 }
135137 // We must resolve the promise here, as otherwise we will have `loading` state in the app until `queryFn` resolves
136138 return persistedQuery . state . data as T
@@ -218,7 +220,7 @@ export function experimental_createQueryPersister<TStorageValue = string>({
218220
219221 if ( matchesFilter && storage != null ) {
220222 // Persist if we have storage defined, we use timeout to get proper state to be persisted
221- systemSetTimeoutZero ( ( ) => {
223+ notifyManager . schedule ( ( ) => {
222224 persistQuery ( query )
223225 } )
224226 }
You can’t perform that action at this time.
0 commit comments