We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c406e68 commit a269340Copy full SHA for a269340
src/core/createQuery.ts
@@ -92,11 +92,9 @@ const createQuery = <R, P extends unknown[]>(
92
let timerId: number;
93
94
if (loadingDelay) {
95
- timerId = setTimeout(() => {
96
- setState({
97
- loading: true,
98
- });
99
- }, loadingDelay);
+ timerId = setTimeout(setState, loadingDelay, {
+ loading: true,
+ });
100
}
101
102
return () => timerId && clearTimeout(timerId);
@@ -110,9 +108,7 @@ const createQuery = <R, P extends unknown[]>(
110
108
pollingHiddenFlag.value = true;
111
109
return;
112
113
114
- pollingFunc();
115
- }, pollingInterval);
+ timerId = setTimeout(pollingFunc, pollingInterval);
116
117
118
0 commit comments