UNPKG

483 BTypeScriptView Raw
1import * as React from 'react';
2/**
3 * Generates a function to be attached to a React component, which can be called
4 * as a replacement to setTimeout. In-flight async calls will be auto canceled if the component
5 * is unmounting before the async code is executed, preventing bugs where code
6 * accesses things within the component after being unmounted.
7 */
8export declare const safeSetTimeout: (component: React.Component<{}, {}, any>) => (cb: Function, duration: number) => void;