mitt
mitt copied to clipboard
🥊 Tiny 200 byte functional event emitter / pubsub.
195b. Forked from #1. - Don't assign `all[type]` in `.off()` - Use a slightly more space-efficient assignment of`all[type]` in `.on()` (no parens). - Return a bound splice from `.on()`. The...
Not sure how far this goes against your ideal of simplicity, but I wonder if you'd thought about variable arity for `emit`? ```ts emit(type: EventType, ...evt: T[]) { ((all.get(type) ||...
Typescript cannot find types for mitt when targeting esm while declaring `moduleResolution: NodeNext`. ```ts import mitt from 'mitt'; // or import { default as mitt } from 'mitt'; ``` Getting...
Good afternoon. What could it be? ``` Uncaught TypeError: (0 , mitt__WEBPACK_IMPORTED_MODULE_5__.default)(...) is not a function ```
#### What is the purpose of this pull request? (put an "X" next to an item) - [ ] Documentation update - [ ] Bug fix - [ ] Feature...
Using mitt in Typescript with `"moduleResolution": "NodeNext"` gives "error TS2349: This expression is not callable." error. ``` "mitt": "^3.0.1" "typescript": "^5.3.3" ``` **tsconfig.json** ```json { "compilerOptions": { "outDir": "dist", "target":...
#### What is the purpose of this pull request? (put an "X" next to an item) - [ ] Documentation update - [ ] Bug fix - [ ] Feature...
Hello, I am using mitt 3.0.1 for my Nuxt app (nuxt 3.6.5). I use event-bus to emit/listen for the whole app: File plugins/event-bus.ts ``` import mitt from 'mitt'; export default...