evg_observable 1.1.26 → 1.1.27
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,5 +1,6 @@
|
|
|
1
|
-
import { ICallback, IListener, IObserver, ISetup, ISubscribe, ISubscribeObject, ISubscriptionLike } from "./Types";
|
|
2
|
-
export declare class SubscribeObject<T> implements ISubscribeObject<T
|
|
1
|
+
import { ICallback, IListener, IMarkedForUnsubscribe, IObserver, ISetup, ISubscribe, ISubscribeObject, ISubscriptionLike } from "./Types";
|
|
2
|
+
export declare class SubscribeObject<T> implements ISubscribeObject<T>, IMarkedForUnsubscribe {
|
|
3
|
+
isMarkedForUnsubscribe: boolean;
|
|
3
4
|
protected observable: IObserver<T> | undefined;
|
|
4
5
|
protected listener: IListener<T> | undefined;
|
|
5
6
|
private isListenPaused;
|
package/src/outLib/Observable.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.Observable = exports.SubscribeObject = void 0;
|
|
|
4
4
|
const FunctionLibs_1 = require("./FunctionLibs");
|
|
5
5
|
class SubscribeObject {
|
|
6
6
|
constructor(observable, listener) {
|
|
7
|
+
this.isMarkedForUnsubscribe = false;
|
|
7
8
|
this.isListenPaused = false;
|
|
8
9
|
this.once = { isOnce: false, isFinished: false };
|
|
9
10
|
this.unsubscribeByNegativeCondition = null;
|
|
@@ -170,7 +171,9 @@ class Observable {
|
|
|
170
171
|
if (this._isDestroyed)
|
|
171
172
|
return;
|
|
172
173
|
if (this.isNextProcess) {
|
|
173
|
-
|
|
174
|
+
const marker = listener;
|
|
175
|
+
!marker.isMarkedForUnsubscribe && this.listenersForUnsubscribe.push(listener);
|
|
176
|
+
marker.isMarkedForUnsubscribe = true;
|
|
174
177
|
return;
|
|
175
178
|
}
|
|
176
179
|
this.listeners &&
|
package/src/outLib/Types.d.ts
CHANGED