Removed outdated (untrue) API docs - chaining was removed in 53a44d8 (#44)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Mateusz Burzyński · committed by Charlike Mike Reagent · parent d728e90 · Browse files · 2 files·+0 added−9 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+0 added−9 removed
- other:+0 added−9 removed
Provenance
- Commit
09a9df0- Tree
6323341- Author
Mateusz Burzyński <mateuszburzynski@gmail.com>- Committer
Charlike Mike Reagent <tunnckoCore@users.noreply.github.com>- Parent
d728e90
2 files changed+0 added−9 removed
modified:src/index.js-3 removed
20 unmodified lines2122232425252627283 unmodified lines3233343537363738395 unmodified lines4546474851495051524 unmodified lines20 unmodified lines * Register an event handler for the given type. * * @param {String} type Type of event to listen for, or `"*"` for all events * @param {Function} handler Function to call in response to given event * @return {Object} the `mitt` instance for chaining * @memberOf mitt */ on(type: string, handler: EventHandler) { (all[type] || (all[type] = [])).push(handler);3 unmodified lines * Remove an event handler for the given type. * * @param {String} type Type of event to unregister `handler` from, or `"*"` * @param {Function} handler Handler function to remove * @return {Object} the `mitt` instance for chaining * @memberOf mitt */ off(type: string, handler: EventHandler) { let e = all[type] || (all[type] = []);5 unmodified lines * If present, `"*"` handlers are invoked prior to type-matched handlers. * * @param {String} type The event type to invoke * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler * @return {Object} the `mitt` instance for chaining * @memberof mitt */ emit(type: string, evt: EventHandler) { (all[type] || []).map((handler) => { handler(evt); });4 unmodified linesmodified:README.md-6 removed
106 unmodified lines107 108 - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The event type to invoke109 - `evt` **\[Any]** Any value (object is recommended and powerful), passed to each handler110 111-Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the `mitt` instance for chaining112-111 ### on112 113 Register an event handler for the given type.114 1 unmodified line116 117 - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to listen for, or `"*"` for all events118 - `handler` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event119 122-Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the `mitt` instance for chaining123-120 ### off121 122 Remove an event handler for the given type.123 1 unmodified line125 126 - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to unregister `handler` from, or `"*"`127 - `handler` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Handler function to remove128 133-Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the `mitt` instance for chaining134-129 ## Contribute130 131 First off, thanks for taking the time to contribute!132 Now, take a moment to be sure your contributions make sense to everyone else.29 unmodified lines