evg_observable 2.14.61 → 2.15.0
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/BREAKING_CHANGES.md +70 -0
- package/package.json +12 -6
- package/src/outLib/src/Libraries/Observables/AbstractSwitchCase.d.ts +37 -0
- package/src/outLib/src/Libraries/Observables/AbstractSwitchCase.js +61 -0
- package/src/outLib/src/Libraries/Observables/Collector.d.ts +56 -0
- package/src/outLib/src/Libraries/Observables/Collector.js +86 -0
- package/src/outLib/src/Libraries/Observables/FilterCollection.d.ts +70 -0
- package/src/outLib/src/Libraries/Observables/FilterCollection.js +122 -0
- package/src/outLib/src/Libraries/Observables/FunctionLibs.d.ts +48 -0
- package/src/outLib/src/Libraries/Observables/FunctionLibs.js +101 -0
- package/src/outLib/src/Libraries/Observables/Observable.d.ts +160 -0
- package/src/outLib/src/Libraries/Observables/Observable.js +268 -0
- package/src/outLib/src/Libraries/Observables/OrderedObservable.d.ts +70 -0
- package/src/outLib/src/Libraries/Observables/OrderedObservable.js +106 -0
- package/src/outLib/src/Libraries/Observables/OrderedSubscribeObject.d.ts +53 -0
- package/src/outLib/src/Libraries/Observables/OrderedSubscribeObject.js +72 -0
- package/src/outLib/src/Libraries/Observables/Pipe.d.ts +108 -0
- package/src/outLib/src/Libraries/Observables/Pipe.js +161 -0
- package/src/outLib/src/Libraries/Observables/SubscribeObject.d.ts +83 -0
- package/src/outLib/src/Libraries/Observables/SubscribeObject.js +139 -0
- package/src/outLib/src/Libraries/Observables/Types.d.ts +727 -0
- package/src/outLib/{index.d.ts → src/Libraries/Observables/index.d.ts} +1 -0
- package/repo/evg_observable.js +0 -1
- package/src/outLib/AbstractSwitchCase.d.ts +0 -8
- package/src/outLib/AbstractSwitchCase.js +0 -32
- package/src/outLib/Collector.d.ts +0 -11
- package/src/outLib/Collector.js +0 -39
- package/src/outLib/FilterCollection.d.ts +0 -17
- package/src/outLib/FilterCollection.js +0 -68
- package/src/outLib/FunctionLibs.d.ts +0 -6
- package/src/outLib/FunctionLibs.js +0 -54
- package/src/outLib/Observable.d.ts +0 -29
- package/src/outLib/Observable.js +0 -130
- package/src/outLib/OrderedObservable.d.ts +0 -11
- package/src/outLib/OrderedObservable.js +0 -47
- package/src/outLib/OrderedSubscribeObject.d.ts +0 -10
- package/src/outLib/OrderedSubscribeObject.js +0 -29
- package/src/outLib/Pipe.d.ts +0 -20
- package/src/outLib/Pipe.js +0 -79
- package/src/outLib/SubscribeObject.d.ts +0 -19
- package/src/outLib/SubscribeObject.js +0 -68
- package/src/outLib/Types.d.ts +0 -165
- /package/src/outLib/{Types.js → src/Libraries/Observables/Types.js} +0 -0
- /package/src/outLib/{index.js → src/Libraries/Observables/index.js} +0 -0
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscribeObject = void 0;
|
|
4
|
-
const Pipe_1 = require("./Pipe");
|
|
5
|
-
const FunctionLibs_1 = require("./FunctionLibs");
|
|
6
|
-
class SubscribeObject extends Pipe_1.Pipe {
|
|
7
|
-
observer;
|
|
8
|
-
listener;
|
|
9
|
-
errorHandler = (errorData, errorMessage) => {
|
|
10
|
-
console.log(`(Unit of SubscribeObject).send(${errorData}) ERROR:`, errorMessage);
|
|
11
|
-
};
|
|
12
|
-
_order = 0;
|
|
13
|
-
paused = false;
|
|
14
|
-
piped = false;
|
|
15
|
-
constructor(observable, isPipe) {
|
|
16
|
-
super();
|
|
17
|
-
this.observer = observable;
|
|
18
|
-
this.piped = !!isPipe;
|
|
19
|
-
}
|
|
20
|
-
subscribe(observer, errorHandler) {
|
|
21
|
-
this.listener = (0, FunctionLibs_1.getListener)(observer);
|
|
22
|
-
errorHandler && (this.errorHandler = errorHandler);
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
unsubscribe() {
|
|
26
|
-
if (!this.observer)
|
|
27
|
-
return;
|
|
28
|
-
this.observer.unSubscribe(this);
|
|
29
|
-
this.observer = null;
|
|
30
|
-
this.listener = null;
|
|
31
|
-
this.chain.length = 0;
|
|
32
|
-
}
|
|
33
|
-
send(value) {
|
|
34
|
-
try {
|
|
35
|
-
this.flow.payload = value;
|
|
36
|
-
this.flow.isBreak = false;
|
|
37
|
-
this.processValue(value);
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
this.errorHandler(value, err);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
resume() {
|
|
44
|
-
this.paused = false;
|
|
45
|
-
}
|
|
46
|
-
pause() {
|
|
47
|
-
this.paused = true;
|
|
48
|
-
}
|
|
49
|
-
get order() {
|
|
50
|
-
return this._order;
|
|
51
|
-
}
|
|
52
|
-
set order(value) {
|
|
53
|
-
this._order = value;
|
|
54
|
-
}
|
|
55
|
-
processValue(value) {
|
|
56
|
-
const listener = this.listener;
|
|
57
|
-
if (!listener)
|
|
58
|
-
return this.unsubscribe();
|
|
59
|
-
if (!this.observer)
|
|
60
|
-
return;
|
|
61
|
-
if (this.paused)
|
|
62
|
-
return;
|
|
63
|
-
if (!this.piped)
|
|
64
|
-
return listener(value);
|
|
65
|
-
return this.processChain(listener);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.SubscribeObject = SubscribeObject;
|
package/src/outLib/Types.d.ts
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { PipeSwitchCase } from "./Pipe";
|
|
2
|
-
import { FilterSwitchCase } from "./FilterCollection";
|
|
3
|
-
export type ICallback<T> = (value?: T) => any;
|
|
4
|
-
export type IErrorCallback = (errorData: any, errorMessage: any) => void;
|
|
5
|
-
export type ISubscribe<T> = {
|
|
6
|
-
subscribe(listener: ISubscribeGroup<T>, errorHandler?: IErrorCallback): ISubscriptionLike | undefined;
|
|
7
|
-
};
|
|
8
|
-
export type IListener<T> = ICallback<T>;
|
|
9
|
-
export type IDestroy = {
|
|
10
|
-
destroy(): void;
|
|
11
|
-
isDestroyed: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type IOrder = {
|
|
14
|
-
order: number;
|
|
15
|
-
};
|
|
16
|
-
export type ISwitch<T> = {
|
|
17
|
-
switch(): PipeSwitchCase<T>;
|
|
18
|
-
};
|
|
19
|
-
export type IOrderedSwitch<T> = {
|
|
20
|
-
switch(): PipeSwitchCase<T>;
|
|
21
|
-
};
|
|
22
|
-
export type IOnce<T> = {
|
|
23
|
-
setOnce(): ISubscribe<T>;
|
|
24
|
-
};
|
|
25
|
-
export type IOrderedOnce<T> = {
|
|
26
|
-
setOnce(): IOrderedSubscribe<T>;
|
|
27
|
-
};
|
|
28
|
-
export type ISetObservableValue = {
|
|
29
|
-
next(value: any): void;
|
|
30
|
-
};
|
|
31
|
-
export type ISubscriptionLike = {
|
|
32
|
-
unsubscribe(): void;
|
|
33
|
-
};
|
|
34
|
-
export type ISetup<T> = IUnsubscribeByPositive<T> & IEmitByPositive<T> & IOnce<T> & ISwitch<T> & ITransform<T> & ISerialisation & ISubscribe<T>;
|
|
35
|
-
export type IOrderedSetup<T> = IOrderedUnsubscribeByPositive<T> & IOrderedEmitByPositive<T> & IOrderedOnce<T> & IOrderedSwitch<T> & IOrderedTransform<T> & IOrderedSerialisation & IOrderedSubscribe<T>;
|
|
36
|
-
export type ISubscribeObject<T> = ISubscriptionLike & IPause & IOrder & ISend<T> & ISetup<T>;
|
|
37
|
-
export type ISubscribeCounter = {
|
|
38
|
-
size(): number;
|
|
39
|
-
};
|
|
40
|
-
export type ISubscriber<T> = {
|
|
41
|
-
getValue(): T | undefined;
|
|
42
|
-
isEnable: boolean;
|
|
43
|
-
} & ISubscribe<T>;
|
|
44
|
-
export type IObserver<T> = ISetObservableValue & ISubscriber<T> & IDestroy & ISubscribeCounter & IObservablePipe<T> & {
|
|
45
|
-
unSubscribe(subscriber: ISubscriptionLike): void;
|
|
46
|
-
unsubscribeAll(): void;
|
|
47
|
-
disable(): void;
|
|
48
|
-
enable(): void;
|
|
49
|
-
};
|
|
50
|
-
export type IStream<T> = {
|
|
51
|
-
stream(value: T[]): void;
|
|
52
|
-
};
|
|
53
|
-
export type IPause = {
|
|
54
|
-
pause(): void;
|
|
55
|
-
resume(): void;
|
|
56
|
-
};
|
|
57
|
-
export type IObservablePipe<T> = {
|
|
58
|
-
pipe(): ISetup<T> | undefined;
|
|
59
|
-
};
|
|
60
|
-
export type IOrderedObservablePipe<T> = {
|
|
61
|
-
pipe(): ISetup<T> | undefined;
|
|
62
|
-
};
|
|
63
|
-
export type ISend<T> = {
|
|
64
|
-
send(value: T): void;
|
|
65
|
-
};
|
|
66
|
-
export type IUnsubscribeByNegative<T> = {
|
|
67
|
-
unsubscribeByNegative(condition: ICallback<T>): ISetup<T>;
|
|
68
|
-
};
|
|
69
|
-
export type IOrderedUnsubscribeByNegative<T> = {
|
|
70
|
-
unsubscribeByNegative(condition: ICallback<T>): IOrderedSetup<T>;
|
|
71
|
-
};
|
|
72
|
-
export type IUnsubscribeByPositive<T> = {
|
|
73
|
-
unsubscribeBy(condition: ICallback<T>): ISetup<T>;
|
|
74
|
-
};
|
|
75
|
-
export type IOrderedUnsubscribeByPositive<T> = {
|
|
76
|
-
unsubscribeBy(condition: ICallback<T>): ISetup<T>;
|
|
77
|
-
};
|
|
78
|
-
export type IEmitByNegative<T> = {
|
|
79
|
-
emitByNegative(condition: ICallback<T>): ISetup<T>;
|
|
80
|
-
};
|
|
81
|
-
export type IOrderedEmitByNegative<T> = {
|
|
82
|
-
emitByNegative(condition: ICallback<T>): IOrderedSetup<T>;
|
|
83
|
-
};
|
|
84
|
-
export type IEmitByPositive<T> = {
|
|
85
|
-
refine(condition: ICallback<T>): ISetup<T>;
|
|
86
|
-
pushRefiners(conditions: ICallback<T>[]): ISetup<T>;
|
|
87
|
-
};
|
|
88
|
-
export type ITransform<T> = {
|
|
89
|
-
then<K>(condition: ICallback<T>): ISetup<K>;
|
|
90
|
-
};
|
|
91
|
-
export type ISerialisation = {
|
|
92
|
-
serialize(): ISetup<string>;
|
|
93
|
-
deserialize<K>(): ISetup<K>;
|
|
94
|
-
};
|
|
95
|
-
export type IOrderedEmitByPositive<T> = {
|
|
96
|
-
refine(condition: ICallback<any>): ISetup<T>;
|
|
97
|
-
pushRefiners(conditions: ICallback<any>[]): ISetup<T>;
|
|
98
|
-
};
|
|
99
|
-
export type IOrderedTransform<T> = {
|
|
100
|
-
then<K>(condition: ICallback<T>): ISetup<K>;
|
|
101
|
-
};
|
|
102
|
-
export type IOrderedSerialisation = {
|
|
103
|
-
serialize(): ISetup<string>;
|
|
104
|
-
deserialize<K>(): ISetup<K>;
|
|
105
|
-
};
|
|
106
|
-
export type IEmitMatchCondition<T> = {
|
|
107
|
-
emitMatch(condition: ICallback<any>): ISetup<T>;
|
|
108
|
-
};
|
|
109
|
-
export type IOrderedEmitMatchCondition<T> = {
|
|
110
|
-
emitMatch(condition: ICallback<any>): IOrderedSetup<T>;
|
|
111
|
-
};
|
|
112
|
-
export type ICollector = IDestroy & ISubscribeCounter & {
|
|
113
|
-
collect(...subscriptionLikeList: ISubscriptionLike[]): void;
|
|
114
|
-
unsubscribe(subscriptionLike: ISubscriptionLike): void;
|
|
115
|
-
unsubscribeAll(): void;
|
|
116
|
-
};
|
|
117
|
-
export type IOrderedObservable = {
|
|
118
|
-
sortByOrder(): boolean;
|
|
119
|
-
};
|
|
120
|
-
export type IOrdered<T> = IObserver<T> & IOrderedObservable & IOrderedObservablePipe<T>;
|
|
121
|
-
export type IOrderedSubscriptionLike = (ISubscriptionLike & IOrder);
|
|
122
|
-
export type IOrderedSubscribe<T> = {
|
|
123
|
-
subscribe(listener: IListener<T>, errorHandler?: IErrorCallback): IOrderedSubscriptionLike;
|
|
124
|
-
};
|
|
125
|
-
export type IChainContainer = {
|
|
126
|
-
chain: any[];
|
|
127
|
-
};
|
|
128
|
-
export type IPipePayload = {
|
|
129
|
-
isBreak: boolean;
|
|
130
|
-
isUnsubscribe: boolean;
|
|
131
|
-
isAvailable: boolean;
|
|
132
|
-
payload: any;
|
|
133
|
-
};
|
|
134
|
-
export type IChainCallback = (data: IPipePayload) => void;
|
|
135
|
-
export type IPipeCase<T> = ISubscribe<T> & {
|
|
136
|
-
case(condition: ICallback<any>): IPipeCase<T> & ISubscribe<T>;
|
|
137
|
-
pushCases(conditions: ICallback<any>[]): IPipeCase<T> & ISubscribe<T>;
|
|
138
|
-
};
|
|
139
|
-
export type ICombinedSubscriber<T> = IListener<T> | ISetObservableValue;
|
|
140
|
-
export type ISubscribeGroup<T> = ICombinedSubscriber<T> | ICombinedSubscriber<T>[];
|
|
141
|
-
export type IAddFilter<T> = {
|
|
142
|
-
addFilter(): IFilterSetup<T>;
|
|
143
|
-
};
|
|
144
|
-
export type IFilterSetup<T> = IFilter<T> & IFilterSwitch<T>;
|
|
145
|
-
export type IFilter<T> = {
|
|
146
|
-
filter(condition: ICallback<any>): IFilterSetup<T>;
|
|
147
|
-
pushFilters(conditions: ICallback<any>[]): IFilterSetup<T>;
|
|
148
|
-
};
|
|
149
|
-
export type IFilterSwitch<T> = {
|
|
150
|
-
switch(): FilterSwitchCase<T>;
|
|
151
|
-
};
|
|
152
|
-
export type IFilterCase<T> = {
|
|
153
|
-
case(condition: ICallback<any>): IFilterCase<T>;
|
|
154
|
-
pushCases(conditions: ICallback<any>[]): IFilterCase<T>;
|
|
155
|
-
};
|
|
156
|
-
export type IFilterPayload = {
|
|
157
|
-
isBreak: boolean;
|
|
158
|
-
isAvailable: boolean;
|
|
159
|
-
payload: any;
|
|
160
|
-
};
|
|
161
|
-
export type IFilterChainCallback = (data: IFilterPayload) => void;
|
|
162
|
-
export type IFilterResponse = {
|
|
163
|
-
isOK: boolean;
|
|
164
|
-
payload: any;
|
|
165
|
-
};
|
|
File without changes
|
|
File without changes
|