Skip to content

Commit

Permalink
style: prefer for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 7, 2020
1 parent 1327e77 commit f74496d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ export function createClient(options: ClientOptions): Client {
};
},
emit<E extends Event>(event: E, ...args: Parameters<EventListener<E>>) {
(listeners[event] as EventListener<E>[]).forEach((listener) => {
for (const listener of listeners[event]) {
// @ts-expect-error: The args should fit
listener(...args);
});
}
},
reset() {
(Object.keys(listeners) as (keyof typeof listeners)[]).forEach(
Expand Down

0 comments on commit f74496d

Please sign in to comment.