Hi everybody.
I make this post to propose an alternative to "MITT" package, for anyone who is interested in event-driven development.
I know it may seem a spam-post but since the package is totally free and under MIT license with public gitHub repo, I see this post simply as an informative piece of news.
The package I posted on NPM it's called "vue-events-backbone" and it has various interesting features apart from the simple "event bus" design, and at the same time its usage remains fairly simple.
The documentation, although covering all aspects of this package with examples, it's in the readme for now.
I'm publishing a simple website where I am going to put a nicer documentation, but since I'm alone in this adventure, I'm currently prioritizing package maintenance, as it is the most important aspect.
PACKAGE FEATURES:
- asynchronous execution of handlers to avoid clogging main thread
- no Vue 3 events handling modification
- DOM-like event propagation through component tree
- plugin installer app.use compatible
- directive installable with app.directive to register event handlers from a component
- event hierarchy definable directly with event naming
- vue3-similar emitters instantiation
- emitter functions return a promise to notify when it has consumed all handlers (in eager mode or lazy)
- stopPropagation capability
- once capability
- transformEvent capability inside handlers to avoid stopPropagation and re-emitting the new event.
- emitEvent capability inside handlers to emit another event on the fly, alongside the current event
- custom event data to pass (even functions, objects etc...)
- possibility to emit an event globally instead of DOM-like events propagation
- error handling to avoid interrupting the propagation
- focus on the ease-of-use
If you have any questions, find any issues or want to propose something, write here.
I check regularly also the "issues" section of the public gitHub repo.
Here is the link to the NPM package: vue-events-backbone