Clears a timeout that was set with setLongTimeout. You can also clear a regular timeout with this function.
setLongTimeout
For example,
import {setLongTimeout, clearLongTimeout} from "lifecycle-utils";const month = 1000 * 60 * 60 * 24 * 7 * 30;const timeout = setLongTimeout(() => { console.log("timeout");}, month);const timeout2 = setTimeout(() => { console.log("timeout2");}, 1000 * 60);clearLongTimeout(timeout);clearLongTimeout(timeout2); Copy
import {setLongTimeout, clearLongTimeout} from "lifecycle-utils";const month = 1000 * 60 * 60 * 24 * 7 * 30;const timeout = setLongTimeout(() => { console.log("timeout");}, month);const timeout2 = setTimeout(() => { console.log("timeout2");}, 1000 * 60);clearLongTimeout(timeout);clearLongTimeout(timeout2);
Clears a timeout that was set with
setLongTimeout
. You can also clear a regular timeout with this function.For example,