UNPKG

390 BJavaScriptView Raw
1/**
2 * Clears a defer or delay callback.
3 *
4 * @example
5 * ``` javascript
6 * import { delay, clear } from 'async-agent';
7 *
8 * const id = delay(() => {
9 * console.log('2');
10 * }, 1000);
11 *
12 * console.log('1');
13 *
14 * clear(id);
15 *
16 * // => 1
17 * ```
18 *
19 * @function clear
20 *
21 * @arg {Number} id - An id returned from defer or delay
22 */
23export default clearTimeout;