Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in async emit once unsubscribers #3

Open
jzombie opened this issue Feb 26, 2025 · 0 comments
Open

Bug in async emit once unsubscribers #3

jzombie opened this issue Feb 26, 2025 · 0 comments

Comments

@jzombie
Copy link

jzombie commented Feb 26, 2025

Shouldn't the once event unsubscribers in an async emit be unsubscribed after the async microtask instead of before?

eventer/src/eventer.js

Lines 388 to 396 in c39a834

if (this.#asyncEmit) {
// trigger event on next async microtask
Promise.resolve().then(triggerEvents);
// process unsubscribes immediately
for (let unsubscribe of onceEventUnsubscribers.values()) {
unsubscribe();
}
onceEventUnsubscribers.clear();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant