mirror of
https://github.com/2234839/web-font.git
synced 2025-05-07 19:22:33 +08:00
typo
This commit is contained in:
parent
c6567b8948
commit
6b49d15eae
@ -49,13 +49,15 @@ function useThrottledMemo<T>(fn: () => T, delay: number): Accessor<T> {
|
|||||||
createMemo(() => {
|
createMemo(() => {
|
||||||
const value = fn();
|
const value = fn();
|
||||||
if (timeoutId === null) {
|
if (timeoutId === null) {
|
||||||
|
// @ts-expect-error
|
||||||
setThrottledValue(value);
|
setThrottledValue(value);
|
||||||
timeoutId = setTimeout(() => {
|
timeoutId = setTimeout(() => {
|
||||||
timeoutId = null;
|
timeoutId = null;
|
||||||
|
// @ts-expect-error
|
||||||
setThrottledValue(fn());
|
setThrottledValue(fn());
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return throttledValue;
|
return throttledValue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user