Fixing memory leak with not removed events

This commit is contained in:
Fabian 2019-04-03 19:31:53 -04:00
parent d0a65f7f4f
commit 9eef107d56
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/utils", "name": "@hibas123/utils",
"version": "2.0.2", "version": "2.0.3",
"description": "Different Utilities, that are not worth own packages", "description": "Different Utilities, that are not worth own packages",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@ -69,6 +69,7 @@ export default class Observable<T = any> {
this.subscriberCollect.forEach(cb => { this.subscriberCollect.forEach(cb => {
cb(this.events) cb(this.events)
}); });
this.events = [];
this.timeout = undefined; this.timeout = undefined;
}, this.collect_intervall); }, this.collect_intervall);
} }