useInterval
Use a setInterval (opens in a new tab) state with some methods to control it.
0
Type Definitions
import { DependencyList } from 'react';
const useInterval: (args: {
callback: () => any;
timeout: number;
startOnMount?: boolean;
deps?: DependencyList;
}) => {
isActive: boolean;
start(): void;
stop(): void;
toggle(force?: boolean): void;
};