tiny-emitter icon indicating copy to clipboard operation
tiny-emitter copied to clipboard

Is there any way to listen to all events irrespective to event name?

Open shubham1164 opened this issue 6 years ago • 3 comments

Using

React-native 0.57

Issue

  1. I want to listen to all the events without knowing the name of the event, is it possible?
  2. I want to cancel all the events, without individually passing the name of all the events in the emitter.off() function

shubham1164 avatar Jan 07 '19 11:01 shubham1164

Based on the source code https://github.com/scottcorgan/tiny-emitter/blob/master/dist/tinyemitter.js - there is no way to do it.

rdewolff avatar Oct 14 '20 12:10 rdewolff

I'd be happen to get that merged if you open a PR!

scottcorgan avatar May 07 '21 15:05 scottcorgan

There actually is. If you emit an event with undefined name, then all listeners will be notified.

Is this a bug or a feature? :-)

Doogiemuc avatar Jan 02 '22 10:01 Doogiemuc