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
One evident "advantage" of using PubSubJS is reducing cognitive load for apps and websites running Javascript on the front- and back-end. PubSubJS allows one to publish-subscribe in a unified way in both client and Node.JS. The vanilla alternative would be to use window.dispatchEvent with custom events on the client side, and EventEmitter in NodeJS.
Performance is obviously one thing, as you are restricted to between 60 (old IE) and 250 async updates per second with setTimeout. We could easily increase performance with one or two order of magnitude by replacing setTimeout with another macrotask scheduling mechanism(for instance usingpostMessagein the browser and nativenextTick` on Node).
An alternative take is the one taken by Emittery, which has no dependencies, and just relies on Promise for async dispatching. That's quite clever and very performant, but obviously not targetting ES3 😄
No description provided.
The text was updated successfully, but these errors were encountered: