aboutsummaryrefslogtreecommitdiff
path: root/test/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/types.ts')
-rw-r--r--test/types.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/test/types.ts b/test/types.ts
deleted file mode 100644
index 23334bb..0000000
--- a/test/types.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import mitt, { EventHandlerList, EventHandlerMap } from '..';
-
-const events = mitt();
-function foo() {}
-events.on('foo', foo);
-events.emit('foo', 'hello');
-
-// handler return type should be ignored:
-events.on('foo', async e => e * 42);
-
-// event map type
-const map = new Map<string, EventHandlerList>([
- ['foo', [foo]]
-]);
-const events2 = mitt(map);
-events2.emit('foo', 'hello');
-
-// event map type & iterables
-const map2 : EventHandlerMap = new Map(Object.entries(({ foo: [foo] })));
-mitt(map2);