@conodene/usetimeout-react-hook
Version:
React.js custom hook that sets a leak-safe timeout and returns a function to cancel it before the timeout expires.
7 lines (6 loc) • 313 B
TypeScript
import { TimeoutHandler } from './TimeoutHandler';
/**
* defaultTimeoutHandler implements the TimeoutHandler interface with the usual timer
* functions available in browsers and in React Native, i.e. `setTimeout` and `clearTimeout`.
*/
export declare const defaultTimeoutHandler: TimeoutHandler<number>;