aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 19 insertions, 22 deletions
diff --git a/README.md b/README.md
index 5220f19..08a21bf 100644
--- a/README.md
+++ b/README.md
@@ -102,38 +102,23 @@ const emitter: mitt.Emitter = mitt();
#### Table of Contents
- [mitt](#mitt)
-- [emit](#emit)
- - [Properties](#properties)
-- [emit](#emit-1)
- - [Parameters](#parameters)
+- [all](#all)
- [on](#on)
- - [Parameters](#parameters-1)
+ - [Parameters](#parameters)
- [off](#off)
+ - [Parameters](#parameters-1)
+- [emit](#emit)
- [Parameters](#parameters-2)
### mitt
Mitt: Tiny (~200b) functional event emitter / pubsub.
-Returns **Mitt**
-
-### emit
-
-#### Properties
-
-- `all` **EventHandlerMap** Contains all registered event handlers.
-
-### emit
-
-Invoke all handlers for the given type.
-If present, `"*"` handlers are invoked after type-matched handlers.
-
-Note: Manually firing "\*" handlers is not supported.
+Returns **Mitt**
-#### Parameters
+### all
-- `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))** The event type to invoke
-- `evt` **Any?** Any value (object is recommended and powerful), passed to each handler
+A Map of event names to registered handler functions.
### on
@@ -153,6 +138,18 @@ Remove an event handler for the given type.
- `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 `"*"`
- `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.
+
+Note: Manually firing "\*" handlers is not supported.
+
+#### Parameters
+
+- `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))** 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!