Comments (6)
Is this a use-case Mitt should support? The point of *
listeners is that they are not individually addressable.
from mitt.
Added to the typescript definition.
from mitt.
@developit may I ask a question on this if you will? As you said before *
listeners couldn't be directly addressable, so do you think it makes sense to warn people about this explicitly while trying to do this, like:
// console.warn says something like "the actions are skipped since wildcard listeners are not individually addressable"
emitter.emit('*')
I think it'd be fewer questions like that, wouldn't it?
from mitt.
Warnings aren't an option in a <200 byte library. TypeScript typings could warn against this, but otherwise it's a documentation issue IMO.
from mitt.
Yeah, typings + a note in documentation seems reasonable (the next question could be answered by a link to it). Would you consider a PR on that or you think it's minor?
from mitt.
Hiya @vitkarpov - sorry for not responding. I would definitely accept a PR to add docs/typings/warnings for this.
from mitt.
Related Issues (20)
- [TypeScript] define events interface HOT 3
- Mitt - some problems HOT 1
- Typescript issue with `moduleResolution: NodeNext` HOT 1
- `dist/mitt.mjs` must not have a sourcemap HOT 5
- mitt extension
- Unpkg CDN Version is down HOT 1
- Using Ag-grid cell renderer with Mitt HOT 1
- Bug: type issue in [email protected]+ with esm HOT 2
- Could we have a minor update? HOT 1
- Doesn't work with typescript 5 moduleResolution set to bundler HOT 11
- vue3 options methods use mitt Invalid HOT 1
- why use sllice & map HOT 2
- Can't pass multiple arguments with emit HOT 2
- How to declare type of event parameter when listen for event HOT 1
- error TS2349: This expression is not callable when using "module": "NodeNext". HOT 5
- Uncaught TypeError: (0 , mitt__WEBPACK_IMPORTED_MODULE_5__.default)(...) is not a function HOT 1
- Emit issue on Vue 3. HOT 1
- How to mock mitt to run tests in Jest? HOT 1
- Handlers calls are aborted if at least one of them generates an error HOT 1
- Request to Implement Unsubscribe Functionality in the Mitt Framework
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 mitt.