replace map with forEach
This commit is contained in:
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-4
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user