sindresorhus/emittery

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Support event namespace #31

Johann-S posted onGitHub

It would be rad if it's possible for creators of libs to create a namespace for their events, it's well used in jQuery for example in Bootstrap.

Bootstrap Modal emit show.bs.modal event, it's allow user to be sure the show event come from the Bootstrap Modal and not an other lib or a general show event.

Currently, except jQuery I don't know an other libs which handle event namespace

See:


Note: This issue has a bounty, so it's expected that you are an experienced programmer and that you give it your best effort if you intend to tackle this. Don't forget, if applicable, to add tests, docs (double-check for typos), and update TypeScript definitions. And don't be sloppy. Review your own diff multiple times and try to find ways to improve and simplify your code. Instead of asking too many questions, present solutions. The point of an issue bounty is to reduce my workload, not give me more. Include a 🦄 in your PR description to indicate that you've read this. Thanks for helping out 🙌 - @sindresorhus


You can already do this. Event namespaces in this sense is just a naming convention.

posted by sindresorhus almost 7 years ago

Yes but it's a bit different, for example, you have a DOM element which have a listener for click.dom.element but if user made a click on this element, we should call the listener because click.dom.element listen to the click event on this element

See: https://codepen.io/Johann-S/pen/WJJQQj

posted by Johann-S almost 7 years ago

@issuehunt has funded $60.00 to this issue.


posted by issuehunt-app[bot] over 5 years ago

The difference between emittery and events emitted from the DOM is that they're global whilst events from emittery is tied to a specific instance. That's why I have a hard time seeing why this is needed.

posted by kevva over 5 years ago

Fund this Issue

$60.00
Funded
Only logged in users can fund an issue

Pull requests

Recent activities

issuehunt funded 60.00 for sindresorhus/emittery# 31
over 5 years ago