evg_observable 1.1.29 → 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/MIT +22 -0
- package/package.json +2 -3
- package/src/outLib/Observable.js +8 -3
- /package/{LICENSE.md → LICENSE} +0 -0
package/MIT
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2021 Grif
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evg_observable",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"description": "Light observable",
|
|
5
|
-
"main": "index.js",
|
|
6
5
|
"directories": {
|
|
7
6
|
"test": "test"
|
|
8
7
|
},
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
"url": "git+https://github.com/BarushevEA/light-observable-ts.git"
|
|
17
16
|
},
|
|
18
17
|
"author": "Barushev E.A.",
|
|
19
|
-
"license": "
|
|
18
|
+
"license": "MIT",
|
|
20
19
|
"bugs": {
|
|
21
20
|
"url": "https://github.com/BarushevEA/light-observable-ts/issues"
|
|
22
21
|
},
|
package/src/outLib/Observable.js
CHANGED
|
@@ -153,13 +153,18 @@ class Observable {
|
|
|
153
153
|
return;
|
|
154
154
|
this.value = value;
|
|
155
155
|
this.isNextProcess = true;
|
|
156
|
-
|
|
156
|
+
const length = this.listeners.length;
|
|
157
|
+
for (let i = 0; i < length; i++) {
|
|
158
|
+
const listener = this.listeners[i];
|
|
157
159
|
listener && listener.send(value);
|
|
160
|
+
}
|
|
158
161
|
this.isNextProcess = false;
|
|
159
|
-
this.handleListenersForUnsubscribe();
|
|
162
|
+
this.listenersForUnsubscribe.length && this.handleListenersForUnsubscribe();
|
|
160
163
|
}
|
|
161
164
|
handleListenersForUnsubscribe() {
|
|
162
|
-
|
|
165
|
+
const length = this.listenersForUnsubscribe.length;
|
|
166
|
+
for (let i = 0; i < length; i++) {
|
|
167
|
+
const listener = this.listenersForUnsubscribe[i];
|
|
163
168
|
this.unSubscribe(listener);
|
|
164
169
|
}
|
|
165
170
|
this.listenersForUnsubscribe.length = 0;
|
/package/{LICENSE.md → LICENSE}
RENAMED
|
File without changes
|