Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add emitAsync method - #36

Merged
maxbrunsfeld merged 1 commit into
masterfrom
mb-emit-async
Sep 12, 2017
Merged

maxbrunsfeld merged 1 commit into
masterfrom
mb-emit-async

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

This adds a new method to the Emitter class: emitAsync. The method behaves like emit except that if any handlers return promises, emitAsync will aggregate those promises via Promise.all, so that applications can wait until events have been handled asynchronously. I plan to use this in Atom's Workspace.onWillDestroyPaneItem and TextBuffer.onWillSave methods.

/cc @nathansobo
/cc @joefitzgerald since I know you were interested in this feature at one time.

@twifty

twifty commented Apr 3, 2018

Copy link
Copy Markdown

This is still an undocumented feature. I only happened by it by looking into the source and it is exactly what my code needs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants