diff options
| author | Jason Miller <[email protected]> | 2020-05-27 12:35:39 -0400 |
|---|---|---|
| committer | Jason Miller <[email protected]> | 2020-05-27 12:35:39 -0400 |
| commit | 59cc3d1bc3b85d347baa8883b6206ba88a6071c0 (patch) | |
| tree | 01b4f434889b19b9b4e448e0155c49b4a876aee9 /src | |
| parent | 3bce9a164db0340cf1cc1b355274f6d419499528 (diff) | |
Use eslint-config-developit
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts index e1503e2..f8e7e64 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,13 +14,13 @@ type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerLis export interface Emitter { on(type: EventType, handler: Handler): void; - on(type: "*", handler: WildcardHandler): void; + on(type: '*', handler: WildcardHandler): void; off(type: EventType, handler: Handler): void; - off(type: "*", handler: WildcardHandler): void; + off(type: '*', handler: WildcardHandler): void; emit<T = any>(type: EventType, event?: T): void; - emit(type: "*", event?: any): void; + emit(type: '*', event?: any): void; } /** Mitt: Tiny (~200b) functional event emitter / pubsub. @@ -31,6 +31,7 @@ export default function mitt(all?: EventHandlerMap): Emitter { all = all || new Map(); return { + /** * Register an event handler for the given type. * @param {string|symbol} type Type of event to listen for, or `"*"` for all events |
