Docs update.
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 f38922a · Browse files · 1 file·+19 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+19 added−13 removed
- other:+19 added−13 removed
Provenance
- Commit
a0578b7- Tree
6627cce- Author
Jason Miller <jason@developit.ca>- Committer
Jason Miller <jason@developit.ca>- Parent
f38922a
1 file changed+19 added−13 removed
modified:README.md+19 added-13 removed
90 unmodified lines9192939495969798991009910010110210310410510110210810910310410510610710810911011111211711811311411511611711811912012112612712212312412512612712812913013113213313413513613713829 unmodified lines90 unmodified lines* * *
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### mitt
Mitt: Tiny (~200b) functional event emitter / pubsub.
Returns **Mitt**
#### emit
Invoke all handlers for the given type.If present, `"*"` handlers are invoked after type-matched handlers.
**Parameters**
- `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The event type to invoke- `evt` **\[Any]** Any value (object is recommended and powerful), passed to each handler- `all` **EventHandlerMap**
Returns **Mitt**
### on
Register an event handler for the given type.
**Parameters**
- `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to listen for, or `"*"` for all events- `handler` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event- `type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to listen for, or `"*"` for all events- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event
### off
Remove an event handler for the given type.
**Parameters**
- `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to unregister `handler` from, or `"*"`- `handler` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Handler function to remove- `type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of event to unregister `handler` from, or `"*"`- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Handler function to remove
### emit
Invoke all handlers for the given type.If present, `"*"` handlers are invoked after type-matched handlers.
**Parameters**
- `type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The event type to invoke- `evt` **Any?** Any value (object is recommended and powerful), passed to each handler
## Contribute
First off, thanks for taking the time to contribute!Now, take a moment to be sure your contributions make sense to everyone else.29 unmodified lines