Register an EventHandler
handlers are called by ascending priority (e.g. priority 0 is called before 1)
a function that calls unhandle for you.
EventHandler for more details
Call the current handlers according to the priority they were registered with.
It's important to realise that even though handlers are free to perform asynchronous actions, they're processed sequentially. If a handler returns a promise, further processing waits until it settles.
Handlers can stop further processing.
a promise that settles when processing is done
Supports handling events of a single type. A typical use case is managing your own EventSource instances and registering handlers and submitting events directly trough them.
Example