diff --git a/src/index.ts b/src/index.ts index e640292..f4e73eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -71,8 +71,8 @@ export default function mitt(all?: EventHandlerMap): Emitter { * @memberOf mitt */ emit(type: EventType, evt: any) { - ((all.get(type) || []) as EventHandlerList).slice().map((handler) => { handler(evt); }); - ((all.get('*') || []) as WildCardEventHandlerList).slice().map((handler) => { handler(type, evt); }); + ((all.get(type) || []) as EventHandlerList).slice().forEach((handler) => { handler(evt); }); + ((all.get('*') || []) as WildCardEventHandlerList).slice().forEach((handler) => { handler(type, evt); }); } }; }