aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2019-04-27 09:57:55 +0300
committerMarin Ivanov <[email protected]>2019-04-27 10:01:33 +0300
commit1fc5ce993a1769a3d0dd5fe2fdb51726f06f804c (patch)
tree620dd3131d112503cf5eabae5c67e2c537b84166 /src/index.ts
parent43dcbd6f83647548464079e628297244145eb4f6 (diff)
Fix TypeScript warning and add caveats to ToC
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 3608ae1..722412b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -37,10 +37,11 @@ export default function nitt(all: EventHandlerMap) {
* @param {Function} handler Function to call in response to given event
*/
once(type: string, handler: EventHandler) {
- const onceHandler = evt => {
+ const onceHandler = (evt: any) => {
handler(evt);
this.off(type, onceHandler);
};
+
this.on(type, onceHandler);
},