Skip to content

Commit

Permalink
Replace Array.from() with spread operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Lovell committed Aug 5, 2024
1 parent 2b1f93d commit 3906daa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class KeyboardListenerAPI {
private rootKeydownListener(e: KeyboardEvent) {
// Iterate over a static copy of the listeners set because listeners might add other listeners
// that we do not want to be included in the loop
for (const listener of Array.from(this.listeners)) {
for (const listener of [...this.listeners]) {
listener(e);
}
this.heldKeys.add(this.toLowerCaseIfInsensitive(e.key));
Expand Down

0 comments on commit 3906daa

Please sign in to comment.