Mitt - some problems
- Vorherrschende Sprache
- TypeScript
- Sterne
- 11.9k
- Forks
- 488
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
**I found some problems with mitt. Will these problems be considered in the future?**
```javascript
const emitter = mitt();
emitter.on("evt", () => {});
emitter.on("evt", () => { throw "some error." })
emitter.on("evt", () => { /** do something... */ })
```
while the
```javascript
emitter.emit("evt");
```
happen, there is no chance to run the third callback.
Also,
```javascript
emitter.on("evt", () => { emitter.off("evt") });
emitter.on("evt", () => { /** do something... */});
emitter.on("evt", () => { emitter.off("*") });
emitter.on("*", () => { /** do something... */});
emitter.on("*", () => { /** do something... */});
emitter.on("*", () => { /** do something... */});
```
while the
```javascript
emitter.emit("evt");
```
happen, there is no chance to run the "*" callback, but can run the second "evt" callback.
Also,
mitt not supports
```javascript
emitter.off(); // off all of the listeners.
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by reproducing the two emit scenarios and the emitter.off() call shown in the issue, then read the current mitt API behavior for listener errors and removals. Decide and document the intended callback and cleanup semantics before adding focused coverage; done means the requested cases have explicit, tested behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100