-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Enable creating listeners using an object/hash (#5975)
Makes listening to multiple events on one target slightly easier. Adding events can be rolled up into passing through an object, and the returned remove function removes all of the handlers in the object For example: ``` //this.listen... const remove = listeners.add( { 'message': handler, 'error': handler } ); remove(); // removes all listeners in the object ``` The entire API for listeners is now becoming slightly overloaded, so potentially we'd use this API always and remove the ability to use a string/function pair.
- Loading branch information
Showing
2 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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