Back to Explore

open-draft/deferred-promise

GitHub
1 updates · last 90 days1 watchersOpen source

Last release: 2 months ago

@open-draft/deferred-promise provides a Promise-compatible `DeferredPromise` (and `createDeferredExecutor`) that lets you create a promise upfront and resolve or reject it later from another part of your system. It is useful when one module needs to return a promise immediately while a different module fulfills the result, similar to Node.js deferred utilities but without creating nested promise instances.

Project status

  • The source appears actively maintained, with the most recent update (v3.0.0) pushed on 2026-03-24, after earlier updates in 2023 and 2022.
  • The update cadence looks intermittent rather than frequent, with a gap from 2023-09-07 (v2.2.0) to 2026-03-24 (v3.0.0).

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.0.0

    2 months ago

    v3.0.0 migrates the package to ESM and updates the toolchain and dependencies. The codebase also refactors the public entrypoint exports for `DeferredPromise` and its deferred executor helpers.

    Breaking
  • v2.2.0

    9/7/2023

    v2.2.0 adds ESM support for @open-draft/deferred-promise and updates the package build/publish setup. The release notes mention ESM support, but the diff shows broader packaging and tooling changes that can affect consumer import behavior and build outputs.

    BreakingFeatures
  • v2.1.0

    12/7/2022

    v2.1.0 focuses on improving Promise compatibility. The code changes indicate a significant internal refactor around how DeferredPromise is implemented, how resolution/rejection is scheduled, and how promise state is tracked across then/catch/finally chains.

    Features
  • v2.0.0

    11/24/2022

    v2.0.0 refactors the library to implement DeferredPromise behavior using a new deferred executor abstraction. It adds Promise chaining support, introduces `createDeferredExecutor()`, and updates types and state naming so awaiting the promise replaces using `DeferredPromise.result`, and `resolved` becomes `fulfilled`.

    BreakingFeatures
  • v1.3.0

    10/20/2022

    v1.3.0 changes DeferredPromise behavior so that calling resolve/reject after the promise has already settled no longer throws an error. The IllegalStateError type and its public export were removed, and the test suite was updated accordingly.

    BreakingFeatures
  • v1.2.1

    10/20/2022

    v1.2.1 makes the IllegalStateError class assign a specific error name, improving how it matches in instanceof-style checks and test assertions. The main runtime change is in src/IllegalStateError.ts, with accompanying test updates to validate error message and state behavior.

  • v1.2.0

    10/20/2022

    v1.2.0 adds a dedicated IllegalStateError and updates DeferredPromise to throw it when resolve or reject is called after the promise is no longer in the pending state. The change also exports IllegalStateError from the package entrypoint and updates tests accordingly.

    BreakingFeatures
  • v1.1.1

    9/26/2022

    v1.1.1 focuses on making DeferredPromise chaining more compatible with Promise semantics. The code changes are primarily TypeScript typing updates for resolve/reject callback return types and for the generic return types of then/catch/finally, plus corresponding test and README updates.

    Breaking
  • v1.1.0

    9/26/2022

    Release v1.1.0 documents a single new feature: support for DeferredPromise.prototype.finally(). The code diff, however, shows additional behavioral and type changes around how then() and catch() interact with the internal promise and how DeferredPromise is typed by default.

    Features
  • v1.0.0

    9/12/2022

    v1.0.0 is the first release of this package. The notes call out a breaking change related to the introduction of an initial DeferredPromise implementation.

    Breaking