@fncts/observable 0.0.31 → 0.0.33
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/Action.d.ts +2 -1
- package/AsyncScheduler.d.ts +1 -1
- package/LICENSE +26 -0
- package/ObservableRef/api.d.ts +3 -3
- package/ObservableRef/definition.d.ts +3 -3
- package/_cjs/Action.cjs +15 -16
- package/_cjs/Action.cjs.map +1 -1
- package/_cjs/AnimationFrameAction.cjs +30 -33
- package/_cjs/AnimationFrameAction.cjs.map +1 -1
- package/_cjs/AnimationFrameScheduler.cjs +30 -35
- package/_cjs/AnimationFrameScheduler.cjs.map +1 -1
- package/_cjs/AsyncAction.cjs +73 -88
- package/_cjs/AsyncAction.cjs.map +1 -1
- package/_cjs/AsyncScheduler.cjs +35 -41
- package/_cjs/AsyncScheduler.cjs.map +1 -1
- package/_cjs/BehaviorSubject.cjs +31 -37
- package/_cjs/BehaviorSubject.cjs.map +1 -1
- package/_cjs/Notification.cjs +65 -70
- package/_cjs/Notification.cjs.map +1 -1
- package/_cjs/Observable/api/connect.cjs +23 -25
- package/_cjs/Observable/api/connect.cjs.map +1 -1
- package/_cjs/Observable/api/connectable.cjs +46 -45
- package/_cjs/Observable/api/connectable.cjs.map +1 -1
- package/_cjs/Observable/api/fromCallback.cjs +44 -48
- package/_cjs/Observable/api/fromCallback.cjs.map +1 -1
- package/_cjs/Observable/api/fromEvent.cjs +15 -15
- package/_cjs/Observable/api/fromEvent.cjs.map +1 -1
- package/_cjs/Observable/api/index.cjs +32 -160
- package/_cjs/Observable/api/race.cjs +26 -30
- package/_cjs/Observable/api/race.cjs.map +1 -1
- package/_cjs/Observable/api/raceWith.cjs +14 -15
- package/_cjs/Observable/api/raceWith.cjs.map +1 -1
- package/_cjs/Observable/api/repeatWhen.cjs +54 -57
- package/_cjs/Observable/api/repeatWhen.cjs.map +1 -1
- package/_cjs/Observable/api/retryWhen.cjs +37 -41
- package/_cjs/Observable/api/retryWhen.cjs.map +1 -1
- package/_cjs/Observable/api/share.cjs +73 -83
- package/_cjs/Observable/api/share.cjs.map +1 -1
- package/_cjs/Observable/api/window.cjs +46 -43
- package/_cjs/Observable/api/window.cjs.map +1 -1
- package/_cjs/Observable/api/windowCount.cjs +45 -51
- package/_cjs/Observable/api/windowCount.cjs.map +1 -1
- package/_cjs/Observable/api/windowTime.cjs +73 -74
- package/_cjs/Observable/api/windowTime.cjs.map +1 -1
- package/_cjs/Observable/api/windowToggle.cjs +71 -74
- package/_cjs/Observable/api/windowToggle.cjs.map +1 -1
- package/_cjs/Observable/api/windowWhen.cjs +59 -55
- package/_cjs/Observable/api/windowWhen.cjs.map +1 -1
- package/_cjs/Observable/api.cjs +1858 -2033
- package/_cjs/Observable/api.cjs.map +1 -1
- package/_cjs/Observable/definition.cjs +107 -120
- package/_cjs/Observable/definition.cjs.map +1 -1
- package/_cjs/Observable/dom/animationFrames.cjs +30 -33
- package/_cjs/Observable/dom/animationFrames.cjs.map +1 -1
- package/_cjs/Observable/instances.cjs +0 -2
- package/_cjs/Observable.cjs +180 -215
- package/_cjs/ObservableRef/api.cjs +188 -156
- package/_cjs/ObservableRef/api.cjs.map +1 -1
- package/_cjs/ObservableRef/atomic.cjs +25 -28
- package/_cjs/ObservableRef/atomic.cjs.map +1 -1
- package/_cjs/ObservableRef/definition.cjs +32 -27
- package/_cjs/ObservableRef/definition.cjs.map +1 -1
- package/_cjs/ObservableRef.cjs +17 -39
- package/_cjs/Observer.cjs +0 -2
- package/_cjs/Operator.cjs +58 -61
- package/_cjs/Operator.cjs.map +1 -1
- package/_cjs/Scheduler.cjs +38 -37
- package/_cjs/Scheduler.cjs.map +1 -1
- package/_cjs/Subject.cjs +163 -202
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/Subscriber.cjs +151 -170
- package/_cjs/Subscriber.cjs.map +1 -1
- package/_cjs/Subscription.cjs +98 -123
- package/_cjs/Subscription.cjs.map +1 -1
- package/_cjs/chunk.cjs +28 -0
- package/_cjs/config.cjs +11 -12
- package/_cjs/config.cjs.map +1 -1
- package/_cjs/global.cjs +0 -2
- package/_cjs/index.cjs +112 -36
- package/_cjs/internal/animationFrameProvider.cjs +32 -38
- package/_cjs/internal/animationFrameProvider.cjs.map +1 -1
- package/_cjs/internal/args.cjs +12 -12
- package/_cjs/internal/args.cjs.map +1 -1
- package/_cjs/internal/intervalProvider.cjs +15 -22
- package/_cjs/internal/intervalProvider.cjs.map +1 -1
- package/_cjs/internal/performanceTimestampProvider.cjs +10 -11
- package/_cjs/internal/performanceTimestampProvider.cjs.map +1 -1
- package/_cjs/internal/timeoutProvider.cjs +15 -22
- package/_cjs/internal/timeoutProvider.cjs.map +1 -1
- package/_cjs/internal/timestampProvider.cjs +10 -11
- package/_cjs/internal/timestampProvider.cjs.map +1 -1
- package/_cjs/internal/util.cjs +60 -68
- package/_cjs/internal/util.cjs.map +1 -1
- package/_mjs/Action.mjs +12 -8
- package/_mjs/Action.mjs.map +1 -1
- package/_mjs/AnimationFrameAction.mjs +25 -24
- package/_mjs/AnimationFrameAction.mjs.map +1 -1
- package/_mjs/AnimationFrameScheduler.mjs +25 -27
- package/_mjs/AnimationFrameScheduler.mjs.map +1 -1
- package/_mjs/AsyncAction.mjs +69 -79
- package/_mjs/AsyncAction.mjs.map +1 -1
- package/_mjs/AsyncScheduler.mjs +32 -34
- package/_mjs/AsyncScheduler.mjs.map +1 -1
- package/_mjs/BehaviorSubject.mjs +28 -29
- package/_mjs/BehaviorSubject.mjs.map +1 -1
- package/_mjs/Notification.mjs +57 -60
- package/_mjs/Notification.mjs.map +1 -1
- package/_mjs/Observable/api/connect.mjs +17 -17
- package/_mjs/Observable/api/connect.mjs.map +1 -1
- package/_mjs/Observable/api/connectable.mjs +39 -35
- package/_mjs/Observable/api/connectable.mjs.map +1 -1
- package/_mjs/Observable/api/fromCallback.mjs +40 -41
- package/_mjs/Observable/api/fromCallback.mjs.map +1 -1
- package/_mjs/Observable/api/fromEvent.mjs +12 -8
- package/_mjs/Observable/api/fromEvent.mjs.map +1 -1
- package/_mjs/Observable/api/index.mjs +15 -15
- package/_mjs/Observable/api/race.mjs +20 -22
- package/_mjs/Observable/api/race.mjs.map +1 -1
- package/_mjs/Observable/api/raceWith.mjs +11 -8
- package/_mjs/Observable/api/raceWith.mjs.map +1 -1
- package/_mjs/Observable/api/repeatWhen.mjs +48 -49
- package/_mjs/Observable/api/repeatWhen.mjs.map +1 -1
- package/_mjs/Observable/api/retryWhen.mjs +31 -33
- package/_mjs/Observable/api/retryWhen.mjs.map +1 -1
- package/_mjs/Observable/api/share.mjs +65 -74
- package/_mjs/Observable/api/share.mjs.map +1 -1
- package/_mjs/Observable/api/window.mjs +38 -34
- package/_mjs/Observable/api/window.mjs.map +1 -1
- package/_mjs/Observable/api/windowCount.mjs +39 -43
- package/_mjs/Observable/api/windowCount.mjs.map +1 -1
- package/_mjs/Observable/api/windowTime.mjs +63 -64
- package/_mjs/Observable/api/windowTime.mjs.map +1 -1
- package/_mjs/Observable/api/windowToggle.mjs +58 -62
- package/_mjs/Observable/api/windowToggle.mjs.map +1 -1
- package/_mjs/Observable/api/windowWhen.mjs +50 -46
- package/_mjs/Observable/api/windowWhen.mjs.map +1 -1
- package/_mjs/Observable/api.mjs +1822 -2030
- package/_mjs/Observable/api.mjs.map +1 -1
- package/_mjs/Observable/definition.mjs +94 -108
- package/_mjs/Observable/definition.mjs.map +1 -1
- package/_mjs/Observable/dom/animationFrames.mjs +23 -23
- package/_mjs/Observable/dom/animationFrames.mjs.map +1 -1
- package/_mjs/Observable/instances.mjs +0 -2
- package/_mjs/Observable.mjs +20 -25
- package/_mjs/ObservableRef/api.mjs +180 -144
- package/_mjs/ObservableRef/api.mjs.map +1 -1
- package/_mjs/ObservableRef/atomic.mjs +21 -20
- package/_mjs/ObservableRef/atomic.mjs.map +1 -1
- package/_mjs/ObservableRef/definition.mjs +29 -19
- package/_mjs/ObservableRef/definition.mjs.map +1 -1
- package/_mjs/ObservableRef.mjs +4 -5
- package/_mjs/Observer.mjs +0 -2
- package/_mjs/Operator.mjs +50 -50
- package/_mjs/Operator.mjs.map +1 -1
- package/_mjs/Scheduler.mjs +30 -26
- package/_mjs/Scheduler.mjs.map +1 -1
- package/_mjs/Subject.mjs +154 -191
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/Subscriber.mjs +136 -156
- package/_mjs/Subscriber.mjs.map +1 -1
- package/_mjs/Subscription.mjs +90 -113
- package/_mjs/Subscription.mjs.map +1 -1
- package/_mjs/config.mjs +10 -6
- package/_mjs/config.mjs.map +1 -1
- package/_mjs/global.mjs +0 -2
- package/_mjs/index.mjs +14 -15
- package/_mjs/internal/animationFrameProvider.mjs +28 -30
- package/_mjs/internal/animationFrameProvider.mjs.map +1 -1
- package/_mjs/internal/args.mjs +9 -5
- package/_mjs/internal/args.mjs.map +1 -1
- package/_mjs/internal/intervalProvider.mjs +14 -16
- package/_mjs/internal/intervalProvider.mjs.map +1 -1
- package/_mjs/internal/performanceTimestampProvider.mjs +9 -5
- package/_mjs/internal/performanceTimestampProvider.mjs.map +1 -1
- package/_mjs/internal/timeoutProvider.mjs +14 -16
- package/_mjs/internal/timeoutProvider.mjs.map +1 -1
- package/_mjs/internal/timestampProvider.mjs +9 -5
- package/_mjs/internal/timestampProvider.mjs.map +1 -1
- package/_mjs/internal/util.mjs +54 -59
- package/_mjs/internal/util.mjs.map +1 -1
- package/_src/Action.ts +2 -0
- package/_src/AsyncScheduler.ts +2 -0
- package/_src/Observable/api.ts +4 -4
- package/_src/ObservableRef/api.ts +36 -12
- package/_src/ObservableRef/definition.ts +12 -4
- package/package.json +6 -2
- package/_cjs/Observable/api/index.cjs.map +0 -1
- package/_cjs/Observable/instances.cjs.map +0 -1
- package/_cjs/Observable.cjs.map +0 -1
- package/_cjs/ObservableRef.cjs.map +0 -1
- package/_cjs/Observer.cjs.map +0 -1
- package/_cjs/global.cjs.map +0 -1
- package/_cjs/index.cjs.map +0 -1
- package/_mjs/Observable/api/index.mjs.map +0 -1
- package/_mjs/Observable/instances.mjs.map +0 -1
- package/_mjs/Observable.mjs.map +0 -1
- package/_mjs/ObservableRef.mjs.map +0 -1
- package/_mjs/Observer.mjs.map +0 -1
- package/_mjs/global.mjs.map +0 -1
- package/_mjs/index.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectable.mjs","names":[
|
|
1
|
+
{"version":3,"file":"connectable.mjs","names":[],"sources":["../../../esm/Observable/api/connectable.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Subject\";\nimport * as tsplus_module_2 from \"@fncts/observable/Observable\";\nimport * as tsplus_module_3 from \"@fncts/observable/Observable/api\";\nconst DEFAULT_CONFIG = {\n connector: () => new tsplus_module_1.Subject(),\n resetOnDisconnect: false,\n};\nexport class Connectable extends tsplus_module_2.Observable {\n connection;\n connector;\n resetOnDisconnect;\n source;\n subject;\n constructor(source, config) {\n const { connector, resetOnDisconnect = true } = config;\n const subject = connector();\n super((subscriber) => {\n return subject.subscribe(subscriber);\n });\n this.connection = null;\n this.subject = subject;\n this.connector = connector;\n this.resetOnDisconnect = resetOnDisconnect;\n this.source = tsplus_module_3.from(source);\n }\n connect() {\n if (!this.connection || this.connection._closed) {\n this.connection = tsplus_module_3.defer(() => this.source).provideEnvironment(this.environment).subscribe(this.subject);\n if (this.resetOnDisconnect) {\n this.connection.add(() => (this.subject = this.connector()));\n }\n }\n return this.connection;\n }\n}\n/**\n * @tsplus pipeable fncts.observable.Observable connectable\n */\nexport function connectable(config = DEFAULT_CONFIG) {\n return (source) => {\n return new Connectable(source, config);\n };\n}\n//# sourceMappingURL=connectable.js.map"],"mappings":";;;;AAGA,MAAM,iBAAiB;CACnB,iBAAiB,IAAI,gBAAgB,SAAS;CAC9C,mBAAmB;CACtB;AACD,IAAa,cAAb,cAAiC,gBAAgB,WAAW;CACxD;CACA;CACA;CACA;CACA;CACA,YAAY,QAAQ,QAAQ;EACxB,MAAM,EAAE,WAAW,oBAAoB,SAAS;EAChD,MAAM,UAAU,WAAW;AAC3B,SAAO,eAAe;AAClB,UAAO,QAAQ,UAAU,WAAW;IACtC;AACF,OAAK,aAAa;AAClB,OAAK,UAAU;AACf,OAAK,YAAY;AACjB,OAAK,oBAAoB;AACzB,OAAK,SAAS,gBAAgB,KAAK,OAAO;;CAE9C,UAAU;AACN,MAAI,CAAC,KAAK,cAAc,KAAK,WAAW,SAAS;AAC7C,QAAK,aAAa,gBAAgB,YAAY,KAAK,OAAO,CAAC,mBAAmB,KAAK,YAAY,CAAC,UAAU,KAAK,QAAQ;AACvH,OAAI,KAAK,kBACL,MAAK,WAAW,UAAW,KAAK,UAAU,KAAK,WAAW,CAAE;;AAGpE,SAAO,KAAK;;;;;;AAMpB,SAAgB,YAAY,SAAS,gBAAgB;AACjD,SAAQ,WAAW;AACf,SAAO,IAAI,YAAY,QAAQ,OAAO"}
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/observable/Subject";
|
|
2
1
|
import * as tsplus_module_2 from "@fncts/observable/Observable";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/observable/Subject";
|
|
3
|
+
//#region build/esm/Observable/api/fromCallback.js
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
* @tsplus static fncts.observable.ObservableOps fromCallback
|
|
6
|
+
*/
|
|
7
|
+
function fromCallback(callbackFunc) {
|
|
8
|
+
return fromCallbackInternal(false, callbackFunc);
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return fromCallbackInternal(true, callbackFunc);
|
|
11
|
+
* @tsplus static fncts.observable.ObservableOps fromNodeCallback
|
|
12
|
+
*/
|
|
13
|
+
function fromNodeCallback(callbackFunc) {
|
|
14
|
+
return fromCallbackInternal(true, callbackFunc);
|
|
15
15
|
}
|
|
16
16
|
function fromCallbackInternal(isNodeStyle, callbackFunc) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return subs;
|
|
46
|
-
});
|
|
47
|
-
};
|
|
17
|
+
return function(...args) {
|
|
18
|
+
const subject = new tsplus_module_1.AsyncSubject();
|
|
19
|
+
let uninitialized = true;
|
|
20
|
+
return new tsplus_module_2.Observable((subscriber) => {
|
|
21
|
+
const subs = subject.subscribe(subscriber);
|
|
22
|
+
if (uninitialized) {
|
|
23
|
+
uninitialized = false;
|
|
24
|
+
let isAsync = false;
|
|
25
|
+
let isComplete = false;
|
|
26
|
+
callbackFunc.apply(this, [...args, (...results) => {
|
|
27
|
+
if (isNodeStyle) {
|
|
28
|
+
const err = results.shift();
|
|
29
|
+
if (err != null) {
|
|
30
|
+
subject.error(err);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
subject.next(1 < results.length ? results : results[0]);
|
|
35
|
+
isComplete = true;
|
|
36
|
+
if (isAsync) subject.complete();
|
|
37
|
+
}]);
|
|
38
|
+
if (isComplete) subject.complete();
|
|
39
|
+
isAsync = true;
|
|
40
|
+
}
|
|
41
|
+
return subs;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
48
44
|
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { fromCallback, fromNodeCallback };
|
|
47
|
+
|
|
49
48
|
//# sourceMappingURL=fromCallback.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromCallback.mjs","names":["fromCallback","
|
|
1
|
+
{"version":3,"file":"fromCallback.mjs","names":[],"sources":["../../../esm/Observable/api/fromCallback.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Subject\";\nimport * as tsplus_module_2 from \"@fncts/observable/Observable\";\n/**\n * @tsplus static fncts.observable.ObservableOps fromCallback\n */\nexport function fromCallback(callbackFunc) {\n return fromCallbackInternal(false, callbackFunc);\n}\n/**\n * @tsplus static fncts.observable.ObservableOps fromNodeCallback\n */\nexport function fromNodeCallback(callbackFunc) {\n // @ts-expect-error\n return fromCallbackInternal(true, callbackFunc);\n}\nfunction fromCallbackInternal(isNodeStyle, callbackFunc) {\n return function (...args) {\n const subject = new tsplus_module_1.AsyncSubject();\n let uninitialized = true;\n return new tsplus_module_2.Observable((subscriber) => {\n const subs = subject.subscribe(subscriber);\n if (uninitialized) {\n uninitialized = false;\n let isAsync = false;\n let isComplete = false;\n callbackFunc.apply(this, [\n ...args,\n (...results) => {\n if (isNodeStyle) {\n const err = results.shift();\n if (err != null) {\n subject.error(err);\n return;\n }\n }\n subject.next(1 < results.length ? results : results[0]);\n isComplete = true;\n if (isAsync) {\n subject.complete();\n }\n },\n ]);\n if (isComplete) {\n subject.complete();\n }\n isAsync = true;\n }\n return subs;\n });\n };\n}\n//# sourceMappingURL=fromCallback.js.map"],"mappings":";;;;;;AAKA,SAAgB,aAAa,cAAc;AACvC,QAAO,qBAAqB,OAAO,aAAa;;;;;AAKpD,SAAgB,iBAAiB,cAAc;AAE3C,QAAO,qBAAqB,MAAM,aAAa;;AAEnD,SAAS,qBAAqB,aAAa,cAAc;AACrD,QAAO,SAAU,GAAG,MAAM;EACtB,MAAM,UAAU,IAAI,gBAAgB,cAAc;EAClD,IAAI,gBAAgB;AACpB,SAAO,IAAI,gBAAgB,YAAY,eAAe;GAClD,MAAM,OAAO,QAAQ,UAAU,WAAW;AAC1C,OAAI,eAAe;AACf,oBAAgB;IAChB,IAAI,UAAU;IACd,IAAI,aAAa;AACjB,iBAAa,MAAM,MAAM,CACrB,GAAG,OACF,GAAG,YAAY;AACZ,SAAI,aAAa;MACb,MAAM,MAAM,QAAQ,OAAO;AAC3B,UAAI,OAAO,MAAM;AACb,eAAQ,MAAM,IAAI;AAClB;;;AAGR,aAAQ,KAAK,IAAI,QAAQ,SAAS,UAAU,QAAQ,GAAG;AACvD,kBAAa;AACb,SAAI,QACA,SAAQ,UAAU;MAG7B,CAAC;AACF,QAAI,WACA,SAAQ,UAAU;AAEtB,cAAU;;AAEd,UAAO;IACT"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/observable/Observable";
|
|
2
|
+
//#region build/esm/Observable/api/fromEvent.js
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
* @tsplus static fncts.observable.ObservableOps fromEvent
|
|
5
|
+
*/
|
|
6
|
+
function fromEvent(addHandler, removeHandler) {
|
|
7
|
+
return new tsplus_module_1.Observable((subscriber) => {
|
|
8
|
+
const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e);
|
|
9
|
+
const retValue = addHandler(handler);
|
|
10
|
+
return removeHandler && (() => removeHandler(handler, retValue));
|
|
11
|
+
});
|
|
11
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { fromEvent };
|
|
15
|
+
|
|
12
16
|
//# sourceMappingURL=fromEvent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromEvent.mjs","names":[
|
|
1
|
+
{"version":3,"file":"fromEvent.mjs","names":[],"sources":["../../../esm/Observable/api/fromEvent.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Observable\";\n/**\n * @tsplus static fncts.observable.ObservableOps fromEvent\n */\nexport function fromEvent(addHandler, removeHandler) {\n return new tsplus_module_1.Observable((subscriber) => {\n const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e);\n const retValue = addHandler(handler);\n return removeHandler && (() => removeHandler(handler, retValue));\n });\n}\n//# sourceMappingURL=fromEvent.js.map"],"mappings":";;;;;AAIA,SAAgB,UAAU,YAAY,eAAe;AACjD,QAAO,IAAI,gBAAgB,YAAY,eAAe;EAClD,MAAM,WAAW,GAAG,MAAM,WAAW,KAAK,EAAE,WAAW,IAAI,EAAE,KAAK,EAAE;EACpE,MAAM,WAAW,WAAW,QAAQ;AACpC,SAAO,wBAAwB,cAAc,SAAS,SAAS;GACjE"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { connect } from "./connect.mjs";
|
|
2
|
+
import { Connectable, connectable } from "./connectable.mjs";
|
|
3
|
+
import { fromCallback, fromNodeCallback } from "./fromCallback.mjs";
|
|
4
|
+
import { fromEvent } from "./fromEvent.mjs";
|
|
5
|
+
import { race, raceInit } from "./race.mjs";
|
|
6
|
+
import { raceWith } from "./raceWith.mjs";
|
|
7
|
+
import { repeatWhen } from "./repeatWhen.mjs";
|
|
8
|
+
import { retryWhen } from "./retryWhen.mjs";
|
|
9
|
+
import { share } from "./share.mjs";
|
|
10
|
+
import { window } from "./window.mjs";
|
|
11
|
+
import { windowCount } from "./windowCount.mjs";
|
|
12
|
+
import { windowTime } from "./windowTime.mjs";
|
|
13
|
+
import { windowToggle } from "./windowToggle.mjs";
|
|
14
|
+
import { windowWhen } from "./windowWhen.mjs";
|
|
15
|
+
export { Connectable, connect, connectable, fromCallback, fromEvent, fromNodeCallback, race, raceInit, raceWith, repeatWhen, retryWhen, share, window, windowCount, windowTime, windowToggle, windowWhen };
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/observable/Observable/api";
|
|
2
1
|
import * as tsplus_module_2 from "@fncts/observable/Observable";
|
|
3
2
|
import * as tsplus_module_3 from "@fncts/observable/Operator";
|
|
3
|
+
import * as tsplus_module_1 from "@fncts/observable/Observable/api";
|
|
4
|
+
//#region build/esm/Observable/api/race.js
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
* @tsplus static fncts.observable.ObservableOps race
|
|
7
|
+
*/
|
|
8
|
+
function race(...sources) {
|
|
9
|
+
return sources.length === 1 ? tsplus_module_1.from(sources[0]) : new tsplus_module_2.Observable(raceInit(sources));
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
subscriber.next(value);
|
|
23
|
-
}
|
|
24
|
-
})));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
11
|
+
function raceInit(sources) {
|
|
12
|
+
return (subscriber, environment) => {
|
|
13
|
+
let subscriptions = [];
|
|
14
|
+
for (let i = 0; subscriptions && !subscriber._closed && i < sources.length; i++) subscriptions.push(tsplus_module_1.from(sources[i]).provideEnvironment(environment).subscribe(tsplus_module_3.operatorSubscriber(subscriber, { next: (value) => {
|
|
15
|
+
if (subscriptions) {
|
|
16
|
+
for (let s = 0; s < subscriptions.length; s++) s !== i && subscriptions[s].unsubscribe();
|
|
17
|
+
subscriptions = null;
|
|
18
|
+
}
|
|
19
|
+
subscriber.next(value);
|
|
20
|
+
} })));
|
|
21
|
+
};
|
|
27
22
|
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { race, raceInit };
|
|
25
|
+
|
|
28
26
|
//# sourceMappingURL=race.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"race.mjs","names":[
|
|
1
|
+
{"version":3,"file":"race.mjs","names":[],"sources":["../../../esm/Observable/api/race.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Observable/api\";\nimport * as tsplus_module_2 from \"@fncts/observable/Observable\";\nimport * as tsplus_module_3 from \"@fncts/observable/Operator\";\n/**\n * @tsplus static fncts.observable.ObservableOps race\n */\nexport function race(...sources) {\n return sources.length === 1 ? tsplus_module_1.from(sources[0]) : new tsplus_module_2.Observable(raceInit(sources));\n}\nexport function raceInit(sources) {\n return (subscriber, environment) => {\n let subscriptions = [];\n for (let i = 0; subscriptions && !subscriber._closed && i < sources.length; i++) {\n subscriptions.push(tsplus_module_1.from(sources[i])\n .provideEnvironment(environment)\n .subscribe(tsplus_module_3.operatorSubscriber(subscriber, {\n next: (value) => {\n if (subscriptions) {\n for (let s = 0; s < subscriptions.length; s++) {\n s !== i && subscriptions[s].unsubscribe();\n }\n subscriptions = null;\n }\n subscriber.next(value);\n },\n })));\n }\n };\n}\n//# sourceMappingURL=race.js.map"],"mappings":";;;;;;;AAMA,SAAgB,KAAK,GAAG,SAAS;AAC7B,QAAO,QAAQ,WAAW,IAAI,gBAAgB,KAAK,QAAQ,GAAG,GAAG,IAAI,gBAAgB,WAAW,SAAS,QAAQ,CAAC;;AAEtH,SAAgB,SAAS,SAAS;AAC9B,SAAQ,YAAY,gBAAgB;EAChC,IAAI,gBAAgB,EAAE;AACtB,OAAK,IAAI,IAAI,GAAG,iBAAiB,CAAC,WAAW,WAAW,IAAI,QAAQ,QAAQ,IACxE,eAAc,KAAK,gBAAgB,KAAK,QAAQ,GAAG,CAC9C,mBAAmB,YAAY,CAC/B,UAAU,gBAAgB,mBAAmB,YAAY,EAC1D,OAAO,UAAU;AACb,OAAI,eAAe;AACf,SAAK,IAAI,IAAI,GAAG,IAAI,cAAc,QAAQ,IACtC,OAAM,KAAK,cAAc,GAAG,aAAa;AAE7C,oBAAgB;;AAEpB,cAAW,KAAK,MAAM;KAE7B,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/observable/Observable";
|
|
2
1
|
import { raceInit } from "./race.mjs";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/observable/Observable";
|
|
3
|
+
//#region build/esm/Observable/api/raceWith.js
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
5
|
+
* @tsplus pipeable fncts.observable.Observablen raceWith
|
|
6
|
+
*/
|
|
7
|
+
function raceWith(...sources) {
|
|
8
|
+
return (fa) => {
|
|
9
|
+
return !sources.length ? fa : new tsplus_module_1.Observable(raceInit([fa, ...sources]));
|
|
10
|
+
};
|
|
11
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { raceWith };
|
|
14
|
+
|
|
12
15
|
//# sourceMappingURL=raceWith.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raceWith.mjs","names":[
|
|
1
|
+
{"version":3,"file":"raceWith.mjs","names":[],"sources":["../../../esm/Observable/api/raceWith.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Observable\";\nimport { raceInit } from \"./race.js\";\n/**\n * @tsplus pipeable fncts.observable.Observablen raceWith\n */\nexport function raceWith(...sources) {\n return (fa) => {\n // @ts-expect-error\n return !sources.length ? fa : new tsplus_module_1.Observable(raceInit([fa, ...sources]));\n };\n}\n//# sourceMappingURL=raceWith.js.map"],"mappings":";;;;;;AAKA,SAAgB,SAAS,GAAG,SAAS;AACjC,SAAQ,OAAO;AAEX,SAAO,CAAC,QAAQ,SAAS,KAAK,IAAI,gBAAgB,WAAW,SAAS,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC"}
|
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/observable/Observable";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/observable/Subject";
|
|
3
2
|
import * as tsplus_module_3 from "@fncts/observable/Operator";
|
|
3
|
+
import * as tsplus_module_2 from "@fncts/observable/Subject";
|
|
4
|
+
//#region build/esm/Observable/api/repeatWhen.js
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
loop();
|
|
51
|
-
});
|
|
52
|
-
};
|
|
6
|
+
* @tsplus pipeable fncts.observable.Observable repeatWhen
|
|
7
|
+
*/
|
|
8
|
+
function repeatWhen(notifier) {
|
|
9
|
+
return (fa) => {
|
|
10
|
+
return new tsplus_module_1.Observable((subscriber, environment) => {
|
|
11
|
+
let innerSub;
|
|
12
|
+
let syncResub = false;
|
|
13
|
+
let completions$;
|
|
14
|
+
let isNotifierComplete = false;
|
|
15
|
+
let isMainComplete = false;
|
|
16
|
+
const checkComplete = () => isMainComplete && isNotifierComplete && (subscriber.complete(), true);
|
|
17
|
+
const getCompletionSubject = () => {
|
|
18
|
+
if (!completions$) {
|
|
19
|
+
completions$ = new tsplus_module_2.Subject();
|
|
20
|
+
notifier(completions$).provideEnvironment(environment).subscribe(tsplus_module_3.operatorSubscriber(subscriber, {
|
|
21
|
+
next: () => {
|
|
22
|
+
if (innerSub) loop();
|
|
23
|
+
else syncResub = true;
|
|
24
|
+
},
|
|
25
|
+
complete: () => {
|
|
26
|
+
isNotifierComplete = true;
|
|
27
|
+
checkComplete();
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
return completions$;
|
|
32
|
+
};
|
|
33
|
+
const loop = () => {
|
|
34
|
+
isMainComplete = false;
|
|
35
|
+
innerSub = fa.provideEnvironment(environment).subscribe(tsplus_module_3.operate_({ complete: () => {
|
|
36
|
+
isMainComplete = true;
|
|
37
|
+
!checkComplete() && getCompletionSubject().next();
|
|
38
|
+
} })(subscriber));
|
|
39
|
+
if (syncResub) {
|
|
40
|
+
innerSub.unsubscribe();
|
|
41
|
+
innerSub = null;
|
|
42
|
+
syncResub = false;
|
|
43
|
+
loop();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
loop();
|
|
47
|
+
});
|
|
48
|
+
};
|
|
53
49
|
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { repeatWhen };
|
|
52
|
+
|
|
54
53
|
//# sourceMappingURL=repeatWhen.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeatWhen.mjs","names":["
|
|
1
|
+
{"version":3,"file":"repeatWhen.mjs","names":[],"sources":["../../../esm/Observable/api/repeatWhen.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Observable\";\nimport * as tsplus_module_2 from \"@fncts/observable/Subject\";\nimport * as tsplus_module_3 from \"@fncts/observable/Operator\";\n/**\n * @tsplus pipeable fncts.observable.Observable repeatWhen\n */\nexport function repeatWhen(notifier) {\n return (fa) => {\n return new tsplus_module_1.Observable((subscriber, environment) => {\n let innerSub;\n let syncResub = false;\n let completions$;\n let isNotifierComplete = false;\n let isMainComplete = false;\n const checkComplete = () => isMainComplete && isNotifierComplete && (subscriber.complete(), true);\n const getCompletionSubject = () => {\n if (!completions$) {\n completions$ = new tsplus_module_2.Subject();\n notifier(completions$)\n .provideEnvironment(environment)\n .subscribe(tsplus_module_3.operatorSubscriber(subscriber, {\n next: () => {\n if (innerSub) {\n loop();\n }\n else {\n syncResub = true;\n }\n },\n complete: () => {\n isNotifierComplete = true;\n checkComplete();\n },\n }));\n }\n return completions$;\n };\n const loop = () => {\n isMainComplete = false;\n innerSub = fa.provideEnvironment(environment).subscribe(tsplus_module_3.operate_({\n complete: () => {\n isMainComplete = true;\n !checkComplete() && getCompletionSubject().next();\n },\n })(subscriber));\n if (syncResub) {\n innerSub.unsubscribe();\n innerSub = null;\n syncResub = false;\n loop();\n }\n };\n loop();\n });\n };\n}\n//# sourceMappingURL=repeatWhen.js.map"],"mappings":";;;;;;;AAMA,SAAgB,WAAW,UAAU;AACjC,SAAQ,OAAO;AACX,SAAO,IAAI,gBAAgB,YAAY,YAAY,gBAAgB;GAC/D,IAAI;GACJ,IAAI,YAAY;GAChB,IAAI;GACJ,IAAI,qBAAqB;GACzB,IAAI,iBAAiB;GACrB,MAAM,sBAAsB,kBAAkB,uBAAuB,WAAW,UAAU,EAAE;GAC5F,MAAM,6BAA6B;AAC/B,QAAI,CAAC,cAAc;AACf,oBAAe,IAAI,gBAAgB,SAAS;AAC5C,cAAS,aAAa,CACjB,mBAAmB,YAAY,CAC/B,UAAU,gBAAgB,mBAAmB,YAAY;MAC1D,YAAY;AACR,WAAI,SACA,OAAM;WAGN,aAAY;;MAGpB,gBAAgB;AACZ,4BAAqB;AACrB,sBAAe;;MAEtB,CAAC,CAAC;;AAEP,WAAO;;GAEX,MAAM,aAAa;AACf,qBAAiB;AACjB,eAAW,GAAG,mBAAmB,YAAY,CAAC,UAAU,gBAAgB,SAAS,EAC7E,gBAAgB;AACZ,sBAAiB;AACjB,MAAC,eAAe,IAAI,sBAAsB,CAAC,MAAM;OAExD,CAAC,CAAC,WAAW,CAAC;AACf,QAAI,WAAW;AACX,cAAS,aAAa;AACtB,gBAAW;AACX,iBAAY;AACZ,WAAM;;;AAGd,SAAM;IACR"}
|
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/observable/Observable";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/observable/Subject";
|
|
3
2
|
import * as tsplus_module_3 from "@fncts/observable/Operator";
|
|
3
|
+
import * as tsplus_module_2 from "@fncts/observable/Subject";
|
|
4
|
+
//#region build/esm/Observable/api/retryWhen.js
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
loop();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
loop();
|
|
35
|
-
});
|
|
36
|
-
};
|
|
6
|
+
* @tsplus pipeable fncts.observable.Observable retryWhen
|
|
7
|
+
*/
|
|
8
|
+
function retryWhen(notifier) {
|
|
9
|
+
return (fa) => {
|
|
10
|
+
return new tsplus_module_1.Observable((subscriber, environment) => {
|
|
11
|
+
let innerSub;
|
|
12
|
+
let syncResub = false;
|
|
13
|
+
let defects$;
|
|
14
|
+
const loop = () => {
|
|
15
|
+
innerSub = fa.provideEnvironment(environment).subscribe(tsplus_module_3.operate_({ error: (err) => {
|
|
16
|
+
if (!defects$) {
|
|
17
|
+
defects$ = new tsplus_module_2.Subject();
|
|
18
|
+
notifier(defects$).provideEnvironment(environment).subscribe(tsplus_module_3.operatorSubscriber(subscriber, { next: () => innerSub ? loop() : syncResub = true }));
|
|
19
|
+
}
|
|
20
|
+
if (defects$) defects$.next(err);
|
|
21
|
+
} })(subscriber));
|
|
22
|
+
if (syncResub) {
|
|
23
|
+
innerSub.unsubscribe();
|
|
24
|
+
innerSub = null;
|
|
25
|
+
syncResub = false;
|
|
26
|
+
loop();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
loop();
|
|
30
|
+
});
|
|
31
|
+
};
|
|
37
32
|
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { retryWhen };
|
|
35
|
+
|
|
38
36
|
//# sourceMappingURL=retryWhen.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryWhen.mjs","names":["
|
|
1
|
+
{"version":3,"file":"retryWhen.mjs","names":[],"sources":["../../../esm/Observable/api/retryWhen.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/observable/Observable\";\nimport * as tsplus_module_2 from \"@fncts/observable/Subject\";\nimport * as tsplus_module_3 from \"@fncts/observable/Operator\";\n/**\n * @tsplus pipeable fncts.observable.Observable retryWhen\n */\nexport function retryWhen(notifier) {\n return (fa) => {\n return new tsplus_module_1.Observable((subscriber, environment) => {\n let innerSub;\n let syncResub = false;\n let defects$;\n const loop = () => {\n innerSub = fa.provideEnvironment(environment).subscribe(tsplus_module_3.operate_({\n error: (err) => {\n if (!defects$) {\n defects$ = new tsplus_module_2.Subject();\n notifier(defects$)\n .provideEnvironment(environment)\n .subscribe(tsplus_module_3.operatorSubscriber(subscriber, {\n next: () => (innerSub ? loop() : (syncResub = true)),\n }));\n }\n if (defects$) {\n defects$.next(err);\n }\n },\n })(subscriber));\n if (syncResub) {\n innerSub.unsubscribe();\n innerSub = null;\n syncResub = false;\n loop();\n }\n };\n loop();\n });\n };\n}\n//# sourceMappingURL=retryWhen.js.map"],"mappings":";;;;;;;AAMA,SAAgB,UAAU,UAAU;AAChC,SAAQ,OAAO;AACX,SAAO,IAAI,gBAAgB,YAAY,YAAY,gBAAgB;GAC/D,IAAI;GACJ,IAAI,YAAY;GAChB,IAAI;GACJ,MAAM,aAAa;AACf,eAAW,GAAG,mBAAmB,YAAY,CAAC,UAAU,gBAAgB,SAAS,EAC7E,QAAQ,QAAQ;AACZ,SAAI,CAAC,UAAU;AACX,iBAAW,IAAI,gBAAgB,SAAS;AACxC,eAAS,SAAS,CACb,mBAAmB,YAAY,CAC/B,UAAU,gBAAgB,mBAAmB,YAAY,EAC1D,YAAa,WAAW,MAAM,GAAI,YAAY,MACjD,CAAC,CAAC;;AAEP,SAAI,SACA,UAAS,KAAK,IAAI;OAG7B,CAAC,CAAC,WAAW,CAAC;AACf,QAAI,WAAW;AACX,cAAS,aAAa;AACtB,gBAAW;AACX,iBAAY;AACZ,WAAM;;;AAGd,SAAM;IACR"}
|