-
Notifications
You must be signed in to change notification settings - Fork 0
EventEmitter.getGroupedListenerList
Dragiyski edited this page Mar 28, 2015
·
2 revisions
Returns the listeners for specified event in topologically sorted groups. That the same order in which emit method would execute them.
emitter.getGroupedListenerList(event);| Argument | Type | Required | Description |
|---|---|---|---|
| event | string | ✓ | The name of the event. |
Returns an array containing arrays containing listener functions.
- The method throws
ReferenceErrorif current graph is not dependency graph, e.g. it has cycles. To distinguish betweenReferenceErrorthrown by bug and intentionally, intentionalReferenceErrorwill have code equal toCIRCULAR_REFERENCEstring.
The returned array contains array we call groups. Each group is an array, but the order within the inner array is implementation specific and irrelevant. All the listeners in the first group can be called in any order, and if someone in the group returns a promise, the others in the group may not wait that promise to resolve. However all returned promises from the first group should be resolved before call listener functions from the second group.