From 9eef107d56920a20fee9672d0de4de34b0b99d4a Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 3 Apr 2019 19:31:53 -0400 Subject: [PATCH] Fixing memory leak with not removed events --- package.json | 2 +- src/observable.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 67661fd..2a5be2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/utils", - "version": "2.0.2", + "version": "2.0.3", "description": "Different Utilities, that are not worth own packages", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/observable.ts b/src/observable.ts index c4ec040..2badc07 100755 --- a/src/observable.ts +++ b/src/observable.ts @@ -69,6 +69,7 @@ export default class Observable { this.subscriberCollect.forEach(cb => { cb(this.events) }); + this.events = []; this.timeout = undefined; }, this.collect_intervall); }