Skip to content
Myr

Add support for mitt.off("type"), which removes all handlers of a given type

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jason Miller · committed by Jason Miller · parent 53eb689 · Browse files · 2 files+7 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−5 removed

  • other:+7 added−5 removed

2 files+7 added−5 removed

modified:src/index.ts+5 added-3 removed
modified:README.md+2 added-2 removed
138 unmodified lines
139140### off141142Remove an event handler for the given type.143If omit the `handler`, all event handlers of the given type are deleted.143If `handler` is omitted, all handlers of the given type are removed.144145#### Parameters146147- `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to unregister `handler` from, or `'*'`148- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Handler function to remove148- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Handler function to remove149150### emit151152Invoke all handlers for the given type.
36 unmodified lines