Sets a timeout that can also be set to a delay longer than the maximum timeout delay supported by a regular setTimeout. You can use clearLongTimeout to clear the timeout.
setTimeout
clearLongTimeout
For example,
import {setLongTimeout, clearLongTimeout} from "lifecycle-utils";const month = 1000 * 60 * 60 * 24 * 7 * 30;const timeout = setLongTimeout(() => { console.log("timeout");}, month);// to clear the timeout, call clearLongTimeout// clearLongTimeout(timeout); Copy
import {setLongTimeout, clearLongTimeout} from "lifecycle-utils";const month = 1000 * 60 * 60 * 24 * 7 * 30;const timeout = setLongTimeout(() => { console.log("timeout");}, month);// to clear the timeout, call clearLongTimeout// clearLongTimeout(timeout);
Sets a timeout that can also be set to a delay longer than the maximum timeout delay supported by a regular
setTimeout
. You can useclearLongTimeout
to clear the timeout.For example,