Function clearLongTimeout

  • Clears a timeout that was set with setLongTimeout. You can also clear a regular timeout with this function.

    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);

    Parameters

    • timeout: undefined | null | number | LongTimeout | Timeout

    Returns void