PackageTrack

npm · #3887

@open-draft/deferred-promise

3.0.0open-draft/deferred-promise

A Promise-compatible abstraction that defers resolving/rejecting promises to another closure.

Release timeline

10 releases since 2022
2023202420252026

Releases

  1. 3.0.024 Mar 2026
    Release notes

    v3.0.0 (2026-03-24)

    ⚠️ BREAKING CHANGES

    • migrate to esm, update dependencies (#11) (21dfbc504dbfbd205f87605b21a089697f328ac0) @kettanaito
    Open source →
  2. 2.2.07 Sept 2023
    Release notes

    v2.2.0 (2023-09-07)

    Features

    • support esm (#9) (b30f1b683311030e92fcdd08d2bd6574d652b77f) @kettanaito
    Open source →
  3. 2.1.07 Dec 2022
    Release notes

    v2.1.0 (2022-12-07)

    Features

    • improve Promise compatibility (#6) (fcd0feeed2221a84cb0354d9a57c42bc32e7ca4c), @jonaskuske
    Open source →
  4. 2.0.024 Nov 2022
    Release notes

    v2.0.0 (2022-11-24)

    ⚠️ BREAKING CHANGES

    • add deferred executor, support chaining (#4) (1fe382e81d5836769a4b5b2be78a28cffe0967f9)

    Deferred promises are now implemented via the deferred executor function. There are no changes to the existing public API.

    Changes

    • Supports Promise chaining.
    • Adds createDeferredExecutor to use this library with any Promise.
    • Improves type annotations in regard to what the deferred promise expects as the input and what is the promise's output:
    const p = new DeferredPromise<number>()
      .then(() => 'hello')
    
    // The input must be "number".
    p.resolve(5)
    
    // the output is "string"
    // (the result of the "then" chain)
    await p // "hello"
    
    • Deprecated: Removes DeferredPromise.result. Access the result by awaiting the promise instead.
    • Deprecated: The resolved promise state is replaced by fulfilled, which is the correct promise state representation per specification.
    Open source →
  5. 1.3.020 Oct 2022
    Release notes

    v1.3.0 (2022-10-20)

    Features

    • do not throw on illegal state (3cd0983a6991bdc14e3411705c3099d7bdf352a6)
    Open source →
  6. 1.2.120 Oct 2022
    Release notes

    v1.2.1 (2022-10-20)

    Bug Fixes

    • IllegalStateError: set custom name for instanceof matching (1137d7181240f30069d6aee55f6a40a497e4e225)
    Open source →
  7. 1.2.020 Oct 2022
    Release notes

    v1.2.0 (2022-10-20)

    Features

    • throw IllegalStateError upon illegal state (#3) (9819dcd41629843dafd2a180ff41c572fe31381a)
    Open source →
  8. 1.1.126 Sept 2022
    Release notes

    v1.1.1 (2022-09-26)

    Bug Fixes

    • improve methods chaining compatibility (#2) (05e7e938f540bcedd7c740cab0d58032e3657b07)
    Open source →
  9. 1.1.026 Sept 2022
    Release notes

    v1.1.0 (2022-09-26)

    Features

    • support ".finally()" (#1) (1fcebb20692f201ccf17e0d141905674de8d1c77)
    Open source →
  10. 1.0.012 Sept 2022
    Release notes

    v1.0.0 (2022-09-12)

    ⚠️ BREAKING CHANGES

    • add initial DeferredPromise implementation (512313d55168022b831a5cdba95dc03cf087c1eb)

    This is a 1.0 release.

    Open source →