Skip to content

Commit

Permalink
style: correct emitter reset
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Sep 10, 2020
1 parent 730d8eb commit 535f7a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ export function createClient(options: ClientOptions): Client {
});
},
reset() {
Object.entries(listeners).forEach(([, eventListeners]) => {
eventListeners = [];
});
(Object.keys(listeners) as (keyof typeof listeners)[]).forEach(
(event) => {
listeners[event] = [];
},
);
},
};
})();
Expand Down

0 comments on commit 535f7a2

Please sign in to comment.