1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-18 11:05:16 +00:00

Feathers: event listeners

This commit is contained in:
Julien Le Coupanec 2018-02-04 17:45:17 +00:00
parent 2cd1e38b0e
commit a27ab16eb9

View File

@ -87,6 +87,7 @@ myService.hooks(hooks) // register hooks for this se
myService.publish([event, ] publisher) // register an event publishing callback
myService.mixin(mixin) // extends the functionality of a service
myService.on(eventname, listener) // registers a listener method for the given eventname
myService.once(eventname, listener) // registers a listener method for the given eventname that will be triggered only one time
myService.emit(eventname, data) // emits the event eventname to all event listeners
myService.removeListener(eventname, [ listener ]) // removes all listeners (or the given listener) for eventname