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
I know pubsub-js is more extensive, but could the README clarify what pubsub-js can do that events can't? I understand that to use events similarly, you'd need to create a singleton instance, and from various places in your code, call the subscription and publishing/emitting functions on that instance.
The text was updated successfully, but these errors were encountered:
If you chose to use EventEmitter or similar as a singleton, you've basically created an implementation of publish/subscribe, very similar to PubSubJS. I think that both options are quite stable, so either would be a decent choice.
If you chose to go with EventEmitter, then I'd recommend creating the singleton in a file that can then be imported where needed, so you don't have to explicitly pass the singleton around. That's just a matter of convenience really.
There might be minor difference in features that make one solution more appealing than the other. Maybe one has a feature/method that you need, and the other doesn't.
If you feel like it, then a PR comparing PubSubJS with other solutions in a table, would be a nice addition to the README.
Colleagues are asking whether to use pubsub-js or https://github.com/Gozala/events for a project.
I know pubsub-js is more extensive, but could the README clarify what pubsub-js can do that
events
can't? I understand that to useevents
similarly, you'd need to create a singleton instance, and from various places in your code, call the subscription and publishing/emitting functions on that instance.The text was updated successfully, but these errors were encountered: