@zoodogood/utils 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ class CustomCollector {
|
|
|
15
15
|
setCallback(callback){
|
|
16
16
|
|
|
17
17
|
const handler = (...params) => {
|
|
18
|
-
const passed = this
|
|
18
|
+
const passed = !this.filter || this.filter(params);
|
|
19
19
|
|
|
20
20
|
if (!!passed === true){
|
|
21
21
|
callback.apply(this, params);
|
|
@@ -37,8 +37,13 @@ class CustomCollector {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
end(){
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (this.timeoutId){
|
|
41
|
+
this.removeTimeout();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (this.#callback){
|
|
45
|
+
this.target.removeListener(this.event, this.#callback);
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
removeTimeout(){
|