You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
I figure I could make another package myself or monkeypatch for my own needs, but I wanted to see if anyone was open to the idea of adding this to Emitter.
It would be nice if Emitter had a onAny method that worked the same as on, but listeners registered would be triggered when any event is emitted.
The only issue I can see with this is that listeners could not be called in the order they were subscribed (i.e., all onAny listeners will be invoked before the on listeners). I don't think Emitter makes any guarantees about callback order, but it's understandable if this is too much of a surprise for users of Emitter.
The text was updated successfully, but these errors were encountered:
It is possible, but at that point I would just monkeypatch emit to trigger the did-anything event automatically to avoid having to manually do it every time I needed it. Adding .onAny only serves to avoid that monkeypatching.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I figure I could make another package myself or monkeypatch for my own needs, but I wanted to see if anyone was open to the idea of adding this to Emitter.
It would be nice if Emitter had a
onAny
method that worked the same ason
, but listeners registered would be triggered when any event is emitted.The only issue I can see with this is that listeners could not be called in the order they were subscribed (i.e., all
onAny
listeners will be invoked before theon
listeners). I don't think Emitter makes any guarantees about callback order, but it's understandable if this is too much of a surprise for users of Emitter.The text was updated successfully, but these errors were encountered: