mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
Replace Array.from() with spread operator
This commit is contained in:
parent
2b1f93d232
commit
3906daad54
@ -48,7 +48,7 @@ export class KeyboardListenerAPI {
|
|||||||
private rootKeydownListener(e: KeyboardEvent) {
|
private rootKeydownListener(e: KeyboardEvent) {
|
||||||
// Iterate over a static copy of the listeners set because listeners might add other listeners
|
// 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
|
// 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);
|
listener(e);
|
||||||
}
|
}
|
||||||
this.heldKeys.add(this.toLowerCaseIfInsensitive(e.key));
|
this.heldKeys.add(this.toLowerCaseIfInsensitive(e.key));
|
||||||
|
Loading…
Reference in New Issue
Block a user