Library API
    Preparing search index...

    Class Pledge<T>

    A lightweight wrapper around Promises (utilizing Promise.withResolvers) that exposes resolve, reject, and state-tracking methods. Useful for deferred execution and managing asynchronous lifecycles.

    const p = new Pledge`<string>`('MyPledge');
    p.resolve('Success!');
    await p.promise; // 'Success!'

    Type Parameters

    • T
    Index

    Constructors

    Accessors

    Methods