Typescript updates (#9658)
* Typescript updates * Update @types/node * Fix more types
This commit is contained in:
parent
baaa9f5dd2
commit
d258402186
59 changed files with 86 additions and 90 deletions
|
@ -30,7 +30,7 @@ export function useDebouncedCallback<T extends any[]>(
|
|||
callback(...params);
|
||||
};
|
||||
if (enabled !== false) {
|
||||
handle = setTimeout(doSearch, DEBOUNCE_TIMEOUT);
|
||||
handle = window.setTimeout(doSearch, DEBOUNCE_TIMEOUT);
|
||||
return () => {
|
||||
if (handle) {
|
||||
clearTimeout(handle);
|
||||
|
|
|
@ -30,7 +30,7 @@ export const useTimeout = (handler: Handler, timeoutMs: number) => {
|
|||
|
||||
// Set up timer
|
||||
useEffect(() => {
|
||||
const timeoutID = setTimeout(() => {
|
||||
const timeoutID = window.setTimeout(() => {
|
||||
savedHandler.current();
|
||||
}, timeoutMs);
|
||||
return () => clearTimeout(timeoutID);
|
||||
|
@ -49,7 +49,7 @@ export const useInterval = (handler: Handler, intervalMs: number) => {
|
|||
|
||||
// Set up timer
|
||||
useEffect(() => {
|
||||
const intervalID = setInterval(() => {
|
||||
const intervalID = window.setInterval(() => {
|
||||
savedHandler.current();
|
||||
}, intervalMs);
|
||||
return () => clearInterval(intervalID);
|
||||
|
|
|
@ -28,7 +28,7 @@ export const useTimeoutToggle = (defaultValue: boolean, timeoutMs: number) => {
|
|||
|
||||
const toggle = () => {
|
||||
setValue(!defaultValue);
|
||||
timeoutId.current = setTimeout(() => setValue(defaultValue), timeoutMs);
|
||||
timeoutId.current = window.setTimeout(() => setValue(defaultValue), timeoutMs);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -68,7 +68,7 @@ function useUserOnboardingContextValue<T>(defaultValue: T, callback: (cli: Matri
|
|||
}
|
||||
setValue(await handler(cli));
|
||||
if (enabled) {
|
||||
handle = setTimeout(repeater, USER_ONBOARDING_CONTEXT_INTERVAL);
|
||||
handle = window.setTimeout(repeater, USER_ONBOARDING_CONTEXT_INTERVAL);
|
||||
}
|
||||
};
|
||||
repeater().catch(err => logger.warn("could not update user onboarding context", err));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue