replace `map` with `forEach`
This commit is contained in:
parent
6b06032c16
commit
6c9dcdbbd6
|
|
@ -22,10 +22,10 @@ class Events {
|
|||
}
|
||||
}
|
||||
|
||||
trigger (name, info) {
|
||||
trigger (name, data) {
|
||||
if (this.events[name] && this.events[name].length) {
|
||||
for (let i = 0; i < this.events[name].length; i++) {
|
||||
this.events[name][i](info);
|
||||
this.events[name][i](data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,8 @@ class Timer {
|
|||
}
|
||||
|
||||
init () {
|
||||
this.types.map((item) => {
|
||||
this.types.forEach((item) => {
|
||||
this[`init${item}Checker`]();
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -64,10 +63,9 @@ class Timer {
|
|||
}
|
||||
|
||||
destroy () {
|
||||
this.types.map((item) => {
|
||||
this.types.forEach((item) => {
|
||||
this[`enable${item}Checker`] = false;
|
||||
this[`${item}Checker`] && clearInterval(this[`${item}Checker`]);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue