Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^1.2.0→^2.0.0Release Notes
sindresorhus/emittery (emittery)
v2.0.0Compare Source
Breaking Changes
Listeners now receive a unified
{name, data}object instead of raw dataAll listeners (
.on(),.onAny(),.once(), async iterators) now receive a single event object withnameanddataproperties instead of the raw event data.For
.onAny():For
.once():For
.events()and.anyEvent()async iterators:For predicates in
.once():emit()now throwsAggregateErrorinstead of rejecting with a single errorWhen multiple listeners throw,
emit()now collects all errors into anAggregateErrorinstead of silently dropping errors after the first one. All listeners always run to completion.try { await emitter.emit('event'); } catch (error) { - // error was from the first listener that threw + // error is an AggregateError with all listener errors in error.errors + console.log(error.errors); }Requires Node.js 22
The minimum required Node.js version is now 22 (previously 14.16).
New Features
init/deinitlifecycle hooks - Register setup/teardown logic that runs when the first listener subscribes and the last listener unsubscribes for a given event.Disposablesupport - Unsubscribe functions from.on()and.onAny()are nowDisposable(usable withusingfor automatic cleanup).AsyncDisposablesupport - Async iterators from.events()and.anyEvent()are nowAsyncDisposable(usable withawait using).AbortSignalsupport for.events(),.anyEvent(), and.once()- Pass{signal}to cancel subscriptions externally..once()options object - Accepts{predicate, signal}in addition to a plain predicate function.Emittery.mixin()now works with both legacy and TC39 standard decorator syntax.Bug Fixes
emit()no longer silently drops errors from multiple listenersemitMetaEventbreaking asyncemit()overrides in subclassesProxyv1.2.1Compare Source
emitSerial()not delivering events to async iteratorsa3c04caConfiguration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.