Comments (6)
We should enforce only strings.
from emittery.
To avoid name collision if you expect an emitter class to be extended and for event you don't especially need to expose.
For those cases, you can add namespace to the event name, or not expose the emitter, but if it doesn't complicate emittery
internals, supporting Symbol
like EventEmitter would be useful.
from emittery.
This will need to be resolved for #1.
from emittery.
Why not support Symbol?
For #1, it just needs to support event key as an array. Even if the list of event key is provided as a string (e.g.: on('start:*')
or on('start:foo start:bar')
), it's just a matter of filtering symbol event keys.
from emittery.
Why do you want support for Symbols? How would you use it?
from emittery.
@dinoboff That's a good use-case. I hadn't thought of that.
from emittery.
Related Issues (20)
- Possible memory-leak in bindMethods
- ReferenceError: exports is not defined in ES module scope HOT 1
- `globalThis.process` references DOM elements with a `#process` ID and crashes app
- [Question] Is it safe to override `emit`? HOT 1
- `yarn test` fails
- Pure ems bundle prevents emittery usage in libraries/frameworks HOT 2
- Wrong listener count for Symbol event names
- Question: Does this works across tabs? HOT 1
- Support AbortController
- v0.9.0 throws a reference error on browser bundles HOT 2
- Uncaught TypeError: Cannot read property 'has' of undefined HOT 4
- Typescript error while trying to listen to multiple events HOT 1
- Arbitrary listener return type (Typescript) HOT 1
- `emit('eventName')` returns as `emit(undefined)` HOT 2
- Fix type compatibility with `p-event`
- No way to prepend listeners or run listeners in reversed order in emit
- `export = Emittery` might not be correct? HOT 1
- Enabling debug can cause circular reference error HOT 3
- Regresssion in PR#96 HOT 4
- No way to unsubscribe from `once` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emittery.