* Invoke all handlers for the given type. * If present, `'*'` handlers are invoked after type-matched handlers. * * Note: Manually firing '*' handlers is not supported. * * @param {string|symbol} type The event type to invoke * @param {Any} [evt] Any value (object is recommended an
(type: Key, evt?: Events[Key])
| 101 | * @memberOf mitt |
| 102 | */ |
| 103 | emit<Key extends keyof Events>(type: Key, evt?: Events[Key]) { |
| 104 | let handlers = all!.get(type); |
| 105 | if (handlers) { |
| 106 | (handlers as EventHandlerList<Events[keyof Events]>) |
| 107 | .slice() |
| 108 | .map((handler) => { |
| 109 | handler(evt!); |
| 110 | }); |
| 111 | } |
| 112 | |
| 113 | handlers = all!.get('*'); |
| 114 | if (handlers) { |
| 115 | (handlers as WildCardEventHandlerList<Events>) |
| 116 | .slice() |
| 117 | .map((handler) => { |
| 118 | handler(type, evt!); |
| 119 | }); |
| 120 | } |
| 121 | } |
| 122 | }; |
| 123 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…