diff options
| author | Severin <[email protected]> | 2017-02-25 22:24:28 +0100 |
|---|---|---|
| committer | Jason Miller <[email protected]> | 2017-02-25 16:24:28 -0500 |
| commit | d63b350e6de3360d05ed6360cfaf101017237a73 (patch) | |
| tree | 4ea94af3c01e2c444a00442e22832bd3532faa3c /README.md | |
| parent | e428f3a171a286ca136f6aa08ac84ea4a892282e (diff) | |
Typescript definitions (#25)
* Added type definitions
* Handler only has exactly one or no argument
* Moved type defs to root folder
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -71,6 +71,12 @@ emitter.on('foo', onFoo) // listen emitter.off('foo', onFoo) // unlisten ``` +### Typescript +```ts +import * as mitt from 'mitt'; +let emitter: mitt.Emitter = new mitt(); +``` + ## Examples & Demos <a href="http://codepen.io/developit/pen/rjMEwW?editors=0110"> @@ -79,6 +85,8 @@ emitter.off('foo', onFoo) // unlisten <img src="https://i.imgur.com/CjBgOfJ.png" width="278" alt="preact + mitt preview"> </a> +* * * + ## API ### mitt |
