replace `map` with `forEach`

This commit is contained in:
DIYgod 2018-03-20 00:35:22 +08:00
parent 6b06032c16
commit 6c9dcdbbd6
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
2 changed files with 4 additions and 6 deletions

View File

@ -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);
}
}
}

View File

@ -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;
});
}
}