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

    Variable promise_withResolversConst

    promise_withResolvers: <T>() => PromiseWithResolvers<T> = ...

    alias for Promise.withResolvers. create a promise with external resolver and rejecter functions, provided in an object form.

    if you'd like a more minifiable version, consider using the array equivalent: promise_outside.

    Warning

    don't invoke this alias on node <= 20, since it isn't available there, and the deno-to-node transformer does not polyfill this function for some reason.

    TODO: in the future, when this is no longer an issue, get rid of the optional chaining operator ("?").

    Type declaration

      • <T>(): PromiseWithResolvers<T>
      • Creates a new Promise and returns it in an object, along with its resolve and reject functions.

        Type Parameters

        • T

        Returns PromiseWithResolvers<T>

        An object with the properties promise, resolve, and reject.

        const { promise, resolve, reject } = Promise.withResolvers<T>();