Events
Events
Events module is implementation of node events.
Module requires no configuration and usage is quite trivial:
Methods
Events provide 4 methods, with familiar publish-subscribe naming pattern:
method
arguments
description
on
(eventName
, callback
)
register listener for provided eventName
off
(eventName
, callback
)
unregister listener for provided eventName
emit
(eventName
, payload
)
emit an event for particular eventName
count
none
returns count<integer>
of registered listeners to particular Event object
Last updated