-
Notifications
You must be signed in to change notification settings - Fork 7.3k
eventEmitter.removeListener calls removed listener within emit cycle #7872
Comments
Two should fire exactly once. |
If this was buggy, it would fire twice. |
OK thanks. Is there a way to prevent listeners from being called if they are removed during the emit cycle? |
Don't create them during the emit cycle. ;) Do it on the next tick or similar. |
This is an intended behavior, sorry. Please continue the discussion on a mailing list. |
@indutny |
The event API (whose interface is frozen) doc specify:
The emitters must be executed in order with which they were attached. Furthermore, there is nothing in |
I am trying to remove an event listener during the emit cycle of an event. I would have thought the following code would not fail. Am I right in this assumption or should all of these event listeners be called?
The text was updated successfully, but these errors were encountered: