@primer/react
Version:
An implementation of GitHub's Primer Design System using React
13 lines • 461 B
TypeScript
type SetTimeout = (handler: TimerHandler, timeout?: number, ...args: unknown[]) => number;
type ClearTimeout = (id: number) => void;
/**
* Safely call `setTimeout` and `clearTimeout` within a component.
*
* This hook ensures that all timeouts are cleared when the component unmounts.
*/
export default function useSafeTimeout(): {
safeSetTimeout: SetTimeout;
safeClearTimeout: ClearTimeout;
};
export {};
//# sourceMappingURL=useSafeTimeout.d.ts.map