@oazmi/kitchensink - v0.10.1
    Preparing search index...

    Interface ScheduleTimeoutConfig

    configuration options for the scheduleTimeout function.

    interface ScheduleTimeoutConfig {
        reject?: boolean;
        runExpired?:
            | boolean
            | "resolve"
            | "reject"
            | (() => boolean | "resolve" | "reject");
    }
    Index

    Properties

    Properties

    reject?: boolean

    when the timeout occurs, should the promise be rejected?

    false (i.e. the timeout promise will be resolved with the value TIMEOUT, rather than being rejected)

    runExpired?:
        | boolean
        | "resolve"
        | "reject"
        | (() => boolean | "resolve" | "reject")

    when the current time is greater than the specified epoch_time_ms (i.e. Date.now() > epoch_time_ms), we call that task expired.

    this option lets you specify what action should be taken when a task is expired:

    • true: resolve/reject the promise immediately (based on the reject option), with the default return value (TIMEOUT).
    • false: keep the promise hanging forever; never to be resolved nor rejected.
    • "resolve": resolve the promise immediately (irrespective of the reject option), with the default return value (TIMEOUT).
    • "reject": reject the promise immediately (irrespective of the reject option), with the default reject value (TIMEOUT).
    • (() => (boolean | "resolve" | "reject")): run a callback function that returns one of the prior specified actions that can be taken.

    true