File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
packages/query-async-storage-persister Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 5959 " !src/__tests__"
6060 ],
6161 "dependencies" : {
62+ "@tanstack/query-core" : " workspace:*" ,
6263 "@tanstack/query-persist-client-core" : " workspace:*"
6364 },
6465 "devDependencies" : {
Original file line number Diff line number Diff line change 1+ import { managedSetTimeout } from '@tanstack/query-core'
12import { noop } from './utils'
23
34interface AsyncThrottleOptions {
@@ -21,11 +22,11 @@ export function asyncThrottle<TArgs extends ReadonlyArray<unknown>>(
2122 if ( isScheduled ) return
2223 isScheduled = true
2324 while ( isExecuting ) {
24- await new Promise ( ( done ) => setTimeout ( done , interval ) )
25+ await new Promise ( ( done ) => managedSetTimeout ( done , interval ) )
2526 }
2627 while ( Date . now ( ) < nextExecutionTime ) {
2728 await new Promise ( ( done ) =>
28- setTimeout ( done , nextExecutionTime - Date . now ( ) ) ,
29+ managedSetTimeout ( done , nextExecutionTime - Date . now ( ) ) ,
2930 )
3031 }
3132 isScheduled = false
You can’t perform that action at this time.
0 commit comments