Skip to content

Commit f6ad309

Browse files
authored
fix(createAsyncStoragePersistor-experimental) fix throttle func (TanStack#2739)
1 parent 0547e62 commit f6ad309

File tree

1 file changed

+3
-2
lines changed
  • src/createWebStoragePersistor-experimental

1 file changed

+3
-2
lines changed

src/createWebStoragePersistor-experimental/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ function throttle<TArgs extends any[]>(
4848
wait = 100
4949
) {
5050
let timer: number | null = null
51-
51+
let params: TArgs
5252
return function (...args: TArgs) {
53+
params = args
5354
if (timer === null) {
5455
timer = setTimeout(() => {
55-
func(...args)
56+
func(...params)
5657
timer = null
5758
}, wait)
5859
}

0 commit comments

Comments
 (0)