evg_observable 1.1.30 → 1.1.31

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
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "evg_observable",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "Light observable",
5
- "main": "index.js",
6
5
  "directories": {
7
6
  "test": "test"
8
7
  },
@@ -24,6 +24,7 @@ class SubscribeObject {
24
24
  subsObj.unsubscribe();
25
25
  return;
26
26
  case subsObj.isListenPaused:
27
+ ;
27
28
  return;
28
29
  case subsObj.once.isOnce:
29
30
  subsObj.once.isFinished = true;
@@ -152,13 +153,18 @@ class Observable {
152
153
  return;
153
154
  this.value = value;
154
155
  this.isNextProcess = true;
155
- for (const listener of this.listeners)
156
+ const length = this.listeners.length;
157
+ for (let i = 0; i < length; i++) {
158
+ const listener = this.listeners[i];
156
159
  listener && listener.send(value);
160
+ }
157
161
  this.isNextProcess = false;
158
- this.handleListenersForUnsubscribe();
162
+ this.listenersForUnsubscribe.length && this.handleListenersForUnsubscribe();
159
163
  }
160
164
  handleListenersForUnsubscribe() {
161
- for (const listener of this.listenersForUnsubscribe) {
165
+ const length = this.listenersForUnsubscribe.length;
166
+ for (let i = 0; i < length; i++) {
167
+ const listener = this.listenersForUnsubscribe[i];
162
168
  this.unSubscribe(listener);
163
169
  }
164
170
  this.listenersForUnsubscribe.length = 0;
File without changes