Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support event namespace #31

Open
Johann-S opened this issue May 11, 2018 · 4 comments
Open

Support event namespace #31

Johann-S opened this issue May 11, 2018 · 4 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@Johann-S
Copy link

Johann-S commented May 11, 2018

Issuehunt badges

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


IssueHunt Summary

Backers (Total: $60.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@sindresorhus
Copy link
Owner

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

@Johann-S
Copy link
Author

Johann-S commented May 11, 2018

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

@issuehunt-oss
Copy link

issuehunt-oss bot commented Sep 19, 2019

@issuehunt has funded $60.00 to this issue.


@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Sep 19, 2019
@kevva
Copy link

kevva commented Sep 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants