@fncts/observable 0.0.9 → 0.0.11
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/BehaviorSubject.d.ts +2 -2
- package/Notification.d.ts +4 -4
- package/Observable/api/connect.d.ts +2 -2
- package/Observable/api/connectable.d.ts +2 -2
- package/Observable/api/fromEvent.d.ts +4 -0
- package/Observable/api/race.d.ts +2 -1
- package/Observable/api/raceWith.d.ts +2 -2
- package/Observable/api/repeatWhen.d.ts +5 -2
- package/Observable/api/retryWhen.d.ts +2 -3
- package/Observable/api/share.d.ts +5 -4
- package/Observable/api/window.d.ts +2 -2
- package/Observable/api/windowCount.d.ts +2 -2
- package/Observable/api/windowTime.d.ts +5 -5
- package/Observable/api/windowToggle.d.ts +3 -3
- package/Observable/api/windowWhen.d.ts +3 -3
- package/Observable/api.d.ts +189 -195
- package/Observable/definition.d.ts +8 -6
- package/ObservableRef/api.d.ts +63 -0
- package/ObservableRef/atomic.d.ts +32 -0
- package/ObservableRef/definition.d.ts +52 -0
- package/Operator.d.ts +2 -2
- package/_cjs/Action.cjs +0 -7
- package/_cjs/Action.cjs.map +1 -1
- package/_cjs/AnimationFrameAction.cjs +0 -12
- package/_cjs/AnimationFrameAction.cjs.map +1 -1
- package/_cjs/AnimationFrameScheduler.cjs +0 -12
- package/_cjs/AnimationFrameScheduler.cjs.map +1 -1
- package/_cjs/AsyncAction.cjs +0 -25
- package/_cjs/AsyncAction.cjs.map +1 -1
- package/_cjs/AsyncScheduler.cjs +2 -16
- package/_cjs/AsyncScheduler.cjs.map +1 -1
- package/_cjs/BehaviorSubject.cjs +1 -13
- package/_cjs/BehaviorSubject.cjs.map +1 -1
- package/_cjs/Notification.cjs +21 -40
- package/_cjs/Notification.cjs.map +1 -1
- package/_cjs/Observable/api/connect.cjs +12 -17
- package/_cjs/Observable/api/connect.cjs.map +1 -1
- package/_cjs/Observable/api/connectable.cjs +6 -18
- package/_cjs/Observable/api/connectable.cjs.map +1 -1
- package/_cjs/Observable/api/fromCallback.cjs +0 -15
- package/_cjs/Observable/api/fromCallback.cjs.map +1 -1
- package/_cjs/Observable/api/fromEvent.cjs +3 -5
- package/_cjs/Observable/api/fromEvent.cjs.map +1 -1
- package/_cjs/Observable/api/index.cjs +0 -28
- package/_cjs/Observable/api/index.cjs.map +1 -1
- package/_cjs/Observable/api/race.cjs +2 -12
- package/_cjs/Observable/api/race.cjs.map +1 -1
- package/_cjs/Observable/api/raceWith.cjs +8 -11
- package/_cjs/Observable/api/raceWith.cjs.map +1 -1
- package/_cjs/Observable/api/repeatWhen.cjs +44 -55
- package/_cjs/Observable/api/repeatWhen.cjs.map +1 -1
- package/_cjs/Observable/api/retryWhen.cjs +29 -45
- package/_cjs/Observable/api/retryWhen.cjs.map +1 -1
- package/_cjs/Observable/api/share.cjs +61 -77
- package/_cjs/Observable/api/share.cjs.map +1 -1
- package/_cjs/Observable/api/window.cjs +33 -39
- package/_cjs/Observable/api/window.cjs.map +1 -1
- package/_cjs/Observable/api/windowCount.cjs +40 -48
- package/_cjs/Observable/api/windowCount.cjs.map +1 -1
- package/_cjs/Observable/api/windowTime.cjs +60 -73
- package/_cjs/Observable/api/windowTime.cjs.map +1 -1
- package/_cjs/Observable/api/windowToggle.cjs +55 -71
- package/_cjs/Observable/api/windowToggle.cjs.map +1 -1
- package/_cjs/Observable/api/windowWhen.cjs +42 -52
- package/_cjs/Observable/api/windowWhen.cjs.map +1 -1
- package/_cjs/Observable/api.cjs +1260 -1485
- package/_cjs/Observable/api.cjs.map +1 -1
- package/_cjs/Observable/definition.cjs +9 -37
- package/_cjs/Observable/definition.cjs.map +1 -1
- package/_cjs/Observable/dom/animationFrames.cjs +0 -12
- package/_cjs/Observable/dom/animationFrames.cjs.map +1 -1
- package/_cjs/Observable.cjs +0 -38
- package/_cjs/Observable.cjs.map +1 -1
- package/_cjs/ObservableRef/api.cjs +160 -0
- package/_cjs/ObservableRef/api.cjs.map +1 -0
- package/_cjs/ObservableRef/atomic.cjs +93 -0
- package/_cjs/ObservableRef/atomic.cjs.map +1 -0
- package/_cjs/ObservableRef/definition.cjs +24 -0
- package/_cjs/ObservableRef/definition.cjs.map +1 -0
- package/_cjs/Operator.cjs +11 -21
- package/_cjs/Operator.cjs.map +1 -1
- package/_cjs/Scheduler.cjs +0 -18
- package/_cjs/Scheduler.cjs.map +1 -1
- package/_cjs/Subject.cjs +3 -50
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/Subscriber.cjs +0 -32
- package/_cjs/Subscriber.cjs.map +1 -1
- package/_cjs/Subscription.cjs +0 -37
- package/_cjs/Subscription.cjs.map +1 -1
- package/_cjs/index.cjs +0 -28
- package/_cjs/internal/animationFrameProvider.cjs +0 -9
- package/_cjs/internal/animationFrameProvider.cjs.map +1 -1
- package/_cjs/internal/args.cjs +0 -6
- package/_cjs/internal/args.cjs.map +1 -1
- package/_cjs/internal/intervalProvider.cjs +0 -2
- package/_cjs/internal/intervalProvider.cjs.map +1 -1
- package/_cjs/internal/performanceTimestampProvider.cjs +0 -1
- package/_cjs/internal/performanceTimestampProvider.cjs.map +1 -1
- package/_cjs/internal/timeoutProvider.cjs +0 -2
- package/_cjs/internal/timeoutProvider.cjs.map +1 -1
- package/_cjs/internal/timestampProvider.cjs +0 -1
- package/_cjs/internal/timestampProvider.cjs.map +1 -1
- package/_cjs/internal/util.cjs +2 -21
- package/_cjs/internal/util.cjs.map +1 -1
- package/_mjs/Action.mjs +0 -3
- package/_mjs/Action.mjs.map +1 -1
- package/_mjs/AnimationFrameAction.mjs +0 -6
- package/_mjs/AnimationFrameAction.mjs.map +1 -1
- package/_mjs/AnimationFrameScheduler.mjs +0 -7
- package/_mjs/AnimationFrameScheduler.mjs.map +1 -1
- package/_mjs/AsyncAction.mjs +0 -17
- package/_mjs/AsyncAction.mjs.map +1 -1
- package/_mjs/AsyncScheduler.mjs +2 -10
- package/_mjs/AsyncScheduler.mjs.map +1 -1
- package/_mjs/BehaviorSubject.mjs +1 -8
- package/_mjs/BehaviorSubject.mjs.map +1 -1
- package/_mjs/Notification.mjs +18 -26
- package/_mjs/Notification.mjs.map +1 -1
- package/_mjs/Observable/api/connect.mjs +12 -11
- package/_mjs/Observable/api/connect.mjs.map +1 -1
- package/_mjs/Observable/api/connectable.mjs +6 -9
- package/_mjs/Observable/api/connectable.mjs.map +1 -1
- package/_mjs/Observable/api/fromCallback.mjs +0 -10
- package/_mjs/Observable/api/fromCallback.mjs.map +1 -1
- package/_mjs/Observable/api/fromEvent.mjs +3 -1
- package/_mjs/Observable/api/fromEvent.mjs.map +1 -1
- package/_mjs/Observable/api/index.mjs.map +1 -1
- package/_mjs/Observable/api/race.mjs +2 -6
- package/_mjs/Observable/api/race.mjs.map +1 -1
- package/_mjs/Observable/api/raceWith.mjs +7 -6
- package/_mjs/Observable/api/raceWith.mjs.map +1 -1
- package/_mjs/Observable/api/repeatWhen.mjs +44 -48
- package/_mjs/Observable/api/repeatWhen.mjs.map +1 -1
- package/_mjs/Observable/api/retryWhen.mjs +29 -37
- package/_mjs/Observable/api/retryWhen.mjs.map +1 -1
- package/_mjs/Observable/api/share.mjs +60 -70
- package/_mjs/Observable/api/share.mjs.map +1 -1
- package/_mjs/Observable/api/window.mjs +32 -33
- 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 +59 -63
- package/_mjs/Observable/api/windowTime.mjs.map +1 -1
- package/_mjs/Observable/api/windowToggle.mjs +54 -62
- package/_mjs/Observable/api/windowToggle.mjs.map +1 -1
- package/_mjs/Observable/api/windowWhen.mjs +41 -45
- package/_mjs/Observable/api/windowWhen.mjs.map +1 -1
- package/_mjs/Observable/api.mjs +1186 -1311
- package/_mjs/Observable/api.mjs.map +1 -1
- package/_mjs/Observable/definition.mjs +9 -24
- package/_mjs/Observable/definition.mjs.map +1 -1
- package/_mjs/Observable/dom/animationFrames.mjs +0 -5
- package/_mjs/Observable/dom/animationFrames.mjs.map +1 -1
- package/_mjs/Observable.mjs +4 -4
- package/_mjs/Observable.mjs.map +1 -1
- package/_mjs/ObservableRef/api.mjs +141 -0
- package/_mjs/ObservableRef/api.mjs.map +1 -0
- package/_mjs/ObservableRef/atomic.mjs +82 -0
- package/_mjs/ObservableRef/atomic.mjs.map +1 -0
- package/_mjs/ObservableRef/definition.mjs +16 -0
- package/_mjs/ObservableRef/definition.mjs.map +1 -0
- package/_mjs/Operator.mjs +11 -12
- package/_mjs/Operator.mjs.map +1 -1
- package/_mjs/Scheduler.mjs +0 -9
- package/_mjs/Scheduler.mjs.map +1 -1
- package/_mjs/Subject.mjs +3 -37
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/Subscriber.mjs +0 -20
- package/_mjs/Subscriber.mjs.map +1 -1
- package/_mjs/Subscription.mjs +0 -26
- package/_mjs/Subscription.mjs.map +1 -1
- package/_mjs/index.mjs.map +1 -1
- package/_mjs/internal/animationFrameProvider.mjs +0 -5
- package/_mjs/internal/animationFrameProvider.mjs.map +1 -1
- package/_mjs/internal/args.mjs +0 -2
- package/_mjs/internal/args.mjs.map +1 -1
- package/_mjs/internal/intervalProvider.mjs +0 -2
- package/_mjs/internal/intervalProvider.mjs.map +1 -1
- package/_mjs/internal/performanceTimestampProvider.mjs +0 -1
- package/_mjs/internal/performanceTimestampProvider.mjs.map +1 -1
- package/_mjs/internal/timeoutProvider.mjs +0 -2
- package/_mjs/internal/timeoutProvider.mjs.map +1 -1
- package/_mjs/internal/timestampProvider.mjs +0 -1
- package/_mjs/internal/timestampProvider.mjs.map +1 -1
- package/_mjs/internal/util.mjs +2 -7
- package/_mjs/internal/util.mjs.map +1 -1
- package/_src/Action.ts +0 -1
- package/_src/AnimationFrameAction.ts +0 -2
- package/_src/AnimationFrameScheduler.ts +2 -7
- package/_src/BehaviorSubject.ts +3 -3
- package/_src/Notification.ts +21 -23
- package/_src/Observable/api/connect.ts +12 -9
- package/_src/Observable/api/connectable.ts +6 -7
- package/_src/Observable/api/fromCallback.ts +0 -1
- package/_src/Observable/api/fromEvent.ts +3 -0
- package/_src/Observable/api/race.ts +15 -13
- package/_src/Observable/api/raceWith.ts +15 -14
- package/_src/Observable/api/repeatWhen.ts +51 -56
- package/_src/Observable/api/retryWhen.ts +38 -43
- package/_src/Observable/api/share.ts +63 -71
- package/_src/Observable/api/window.ts +36 -41
- package/_src/Observable/api/windowCount.ts +44 -51
- package/_src/Observable/api/windowTime.ts +69 -81
- package/_src/Observable/api/windowToggle.ts +69 -73
- package/_src/Observable/api/windowWhen.ts +49 -55
- package/_src/Observable/api.ts +1493 -1498
- package/_src/Observable/definition.ts +24 -18
- package/_src/Observable/dom/animationFrames.ts +16 -6
- package/_src/Observable/instances.ts +0 -23
- package/_src/Observable.ts +0 -2
- package/_src/ObservableRef/api.ts +169 -0
- package/_src/ObservableRef/atomic.ts +85 -0
- package/_src/ObservableRef/definition.ts +57 -0
- package/_src/Operator.ts +20 -15
- package/_src/Scheduler.ts +0 -6
- package/_src/Subject.ts +1 -1
- package/_src/Subscriber.ts +3 -2
- package/_src/global.ts +5 -1
- package/_src/internal/util.ts +8 -4
- package/global.d.ts +5 -1
- package/package.json +2 -2
package/_cjs/Observable/api.cjs
CHANGED
|
@@ -5,48 +5,46 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TimeoutError = void 0;
|
|
7
7
|
exports.ap = ap;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
8
|
+
exports.as = void 0;
|
|
9
|
+
exports.at = at;
|
|
10
|
+
exports.audit = void 0;
|
|
11
|
+
exports.auditTime = auditTime;
|
|
12
|
+
exports.buffer = buffer;
|
|
13
|
+
exports.bufferCount = bufferCount;
|
|
14
|
+
exports.bufferTime = bufferTime;
|
|
15
|
+
exports.bufferToggle = bufferToggle;
|
|
16
|
+
exports.bufferWhen = bufferWhen;
|
|
17
17
|
exports.catchAllCause = void 0;
|
|
18
18
|
exports.combineLatestAll = combineLatestAll;
|
|
19
|
-
exports.concatAll = exports.
|
|
19
|
+
exports.concatAll = exports.concat = void 0;
|
|
20
|
+
exports.concatMap = concatMap;
|
|
20
21
|
exports.concatMapWithIndex = concatMapWithIndex;
|
|
21
|
-
exports.
|
|
22
|
-
exports.contramapEnvironment = exports.concat_ = void 0;
|
|
22
|
+
exports.contramapEnvironment = void 0;
|
|
23
23
|
exports.count = count;
|
|
24
|
+
exports.countWith = countWith;
|
|
24
25
|
exports.countWithIndex = void 0;
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
26
|
+
exports.debounce = debounce;
|
|
27
|
+
exports.debounceWith = debounceWith;
|
|
28
|
+
exports.defer = exports.defaultThrottleConfig = void 0;
|
|
29
|
+
exports.delay = delay;
|
|
30
|
+
exports.delayWithIndex = exports.delayWith = void 0;
|
|
30
31
|
exports.dematerialize = dematerialize;
|
|
31
32
|
exports.either = either;
|
|
32
33
|
exports.empty = void 0;
|
|
33
|
-
exports.
|
|
34
|
+
exports.ensuring = ensuring;
|
|
34
35
|
exports.environmentWithObservable = void 0;
|
|
35
36
|
exports.exhaustAll = exhaustAll;
|
|
37
|
+
exports.exhaustMap = exhaustMap;
|
|
36
38
|
exports.exhaustMapWithIndex = void 0;
|
|
37
|
-
exports.
|
|
38
|
-
exports.expandWithIndex = void 0;
|
|
39
|
-
exports.expand_ = expand_;
|
|
40
|
-
exports.fail = void 0;
|
|
39
|
+
exports.expand = expand;
|
|
40
|
+
exports.fail = exports.expandWithIndex = void 0;
|
|
41
41
|
exports.failCause = failCause;
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.findWithIndex = void 0;
|
|
49
|
-
exports.find_ = find_;
|
|
42
|
+
exports.filter = filter;
|
|
43
|
+
exports.filterMap = filterMap;
|
|
44
|
+
exports.filterWithIndex = exports.filterMapWithIndex = void 0;
|
|
45
|
+
exports.find = find;
|
|
46
|
+
exports.findIndex = findIndex;
|
|
47
|
+
exports.findWithIndex = exports.findIndexWithIndex = void 0;
|
|
50
48
|
exports.flatten = flatten;
|
|
51
49
|
exports.foldLeftWithIndex = exports.foldLeft = void 0;
|
|
52
50
|
exports.forkJoin = forkJoin;
|
|
@@ -67,24 +65,22 @@ exports.isEmpty = isEmpty;
|
|
|
67
65
|
exports.iterate = iterate;
|
|
68
66
|
exports.joinAllInternal = joinAllInternal;
|
|
69
67
|
exports.makeZip = makeZip;
|
|
70
|
-
exports.
|
|
68
|
+
exports.mapError = mapError;
|
|
71
69
|
exports.map_ = exports.mapWithIndex = void 0;
|
|
72
70
|
exports.materialize = materialize;
|
|
73
71
|
exports.merge = merge;
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
76
|
-
exports.
|
|
72
|
+
exports.mergeMapWithIndex = exports.mergeMap = exports.mergeAll = void 0;
|
|
73
|
+
exports.mergeScan = mergeScan;
|
|
74
|
+
exports.onEmpty = exports.of = exports.mergeScanWithIndex = void 0;
|
|
77
75
|
exports.onErrorResumeNext = onErrorResumeNext;
|
|
78
|
-
exports.
|
|
79
|
-
exports.
|
|
80
|
-
exports.partitionWithIndex = void 0;
|
|
81
|
-
exports.partition_ = partition_;
|
|
82
|
-
exports.provideEnvironment = provideEnvironment;
|
|
76
|
+
exports.partition = partition;
|
|
77
|
+
exports.partitionMap = partitionMap;
|
|
78
|
+
exports.partitionWithIndex = exports.partitionMapWithIndex = void 0;
|
|
83
79
|
exports.provideService = provideService;
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
80
|
+
exports.repeat = repeat;
|
|
81
|
+
exports.retry = retry;
|
|
82
|
+
exports.sample = void 0;
|
|
83
|
+
exports.sampleTime = sampleTime;
|
|
88
84
|
exports.scanInternal = scanInternal;
|
|
89
85
|
exports.scanLeft = scanLeft;
|
|
90
86
|
exports.scanLeftWithIndex = void 0;
|
|
@@ -98,82 +94,58 @@ exports.scheduled = void 0;
|
|
|
98
94
|
exports.service = service;
|
|
99
95
|
exports.serviceWith = serviceWith;
|
|
100
96
|
exports.single = exports.serviceWithObservable = void 0;
|
|
101
|
-
exports.
|
|
102
|
-
exports.
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
105
|
-
exports.
|
|
106
|
-
exports.
|
|
97
|
+
exports.skip = skip;
|
|
98
|
+
exports.skipLast = skipLast;
|
|
99
|
+
exports.skipUntil = skipUntil;
|
|
100
|
+
exports.skipWhile = skipWhile;
|
|
101
|
+
exports.startWith = startWith;
|
|
102
|
+
exports.subscribeOn = subscribeOn;
|
|
107
103
|
exports.swap = swap;
|
|
108
104
|
exports.switchAll = switchAll;
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
105
|
+
exports.switchMapWithIndex = exports.switchMap = void 0;
|
|
106
|
+
exports.switchScan = switchScan;
|
|
107
|
+
exports.take = exports.switchScanWithIndex = void 0;
|
|
108
|
+
exports.takeLast = takeLast;
|
|
109
|
+
exports.takeUntil = takeUntil;
|
|
110
|
+
exports.takeWhile = takeWhile;
|
|
113
111
|
exports.takeWhileWithIndex = void 0;
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
-
exports.
|
|
122
|
-
exports.unique_ = unique_;
|
|
112
|
+
exports.tap = tap;
|
|
113
|
+
exports.throttle = void 0;
|
|
114
|
+
exports.throttleTime = throttleTime;
|
|
115
|
+
exports.timeout = timeout;
|
|
116
|
+
exports.toArray = exports.timer = void 0;
|
|
117
|
+
exports.unique = unique;
|
|
118
|
+
exports.uniqueUntilChanged = void 0;
|
|
119
|
+
exports.uniqueUntilKeyChanged = uniqueUntilKeyChanged;
|
|
123
120
|
exports.unit = void 0;
|
|
124
121
|
exports.zip = zip;
|
|
125
|
-
exports.zipWith = void 0;
|
|
126
|
-
|
|
122
|
+
exports.zipWith = exports.zipLatest = void 0;
|
|
123
|
+
exports.zipWithLatest = zipWithLatest;
|
|
127
124
|
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
|
|
128
|
-
|
|
129
125
|
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/internal/util"));
|
|
130
|
-
|
|
131
126
|
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/util/predicates"));
|
|
132
|
-
|
|
133
127
|
var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO"));
|
|
134
|
-
|
|
135
128
|
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/AsyncScheduler"));
|
|
136
|
-
|
|
137
129
|
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Subscription"));
|
|
138
|
-
|
|
139
130
|
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Scheduler"));
|
|
140
|
-
|
|
141
131
|
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Operator"));
|
|
142
|
-
|
|
143
132
|
var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
|
|
144
|
-
|
|
145
133
|
var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/runtime"));
|
|
146
|
-
|
|
147
134
|
var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
|
|
148
|
-
|
|
149
135
|
var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/interrupt"));
|
|
150
|
-
|
|
151
136
|
var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/function/api"));
|
|
152
|
-
|
|
153
137
|
var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/destructors"));
|
|
154
|
-
|
|
155
138
|
var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/destructors"));
|
|
156
|
-
|
|
157
139
|
var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Environment/api"));
|
|
158
|
-
|
|
159
140
|
var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
|
|
160
|
-
|
|
161
141
|
var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
|
|
162
|
-
|
|
163
142
|
var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
|
|
164
|
-
|
|
165
143
|
var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Notification"));
|
|
166
|
-
|
|
167
144
|
var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashSet/api"));
|
|
168
|
-
|
|
169
145
|
var _args = /*#__PURE__*/require("@fncts/observable/internal/args");
|
|
170
|
-
|
|
171
146
|
var _definition2 = /*#__PURE__*/require("@fncts/observable/Observable/definition");
|
|
172
|
-
|
|
173
147
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
174
|
-
|
|
175
148
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
176
|
-
|
|
177
149
|
const fileName_1 = "(@fncts/observable) src/Observable/api.ts";
|
|
178
150
|
const defer = defer_1;
|
|
179
151
|
exports.defer = defer;
|
|
@@ -205,42 +177,42 @@ const mapWithIndex = mapWithIndex_1;
|
|
|
205
177
|
exports.mapWithIndex = mapWithIndex;
|
|
206
178
|
const map_ = map_1;
|
|
207
179
|
exports.map_ = map_;
|
|
208
|
-
const
|
|
209
|
-
exports.
|
|
210
|
-
const
|
|
211
|
-
exports.
|
|
180
|
+
const as = as_1;
|
|
181
|
+
exports.as = as;
|
|
182
|
+
const filterWithIndex = filterWithIndex_1;
|
|
183
|
+
exports.filterWithIndex = filterWithIndex;
|
|
212
184
|
const filterMapWithIndex = filterMapWithIndex_1;
|
|
213
185
|
exports.filterMapWithIndex = filterMapWithIndex;
|
|
214
186
|
const partitionWithIndex = partitionWithIndex_1;
|
|
215
187
|
exports.partitionWithIndex = partitionWithIndex;
|
|
216
|
-
const
|
|
217
|
-
exports.
|
|
188
|
+
const partitionMapWithIndex = partitionMapWithIndex_1;
|
|
189
|
+
exports.partitionMapWithIndex = partitionMapWithIndex;
|
|
218
190
|
const mergeMapWithIndex = mergeMapWithIndex_1;
|
|
219
191
|
exports.mergeMapWithIndex = mergeMapWithIndex;
|
|
220
|
-
const
|
|
221
|
-
exports.
|
|
192
|
+
const mergeMap = mergeMap_1;
|
|
193
|
+
exports.mergeMap = mergeMap;
|
|
222
194
|
const contramapEnvironment = contramapEnvironment_1;
|
|
223
195
|
exports.contramapEnvironment = contramapEnvironment;
|
|
224
196
|
const foldLeftWithIndex = foldLeftWithIndex_1;
|
|
225
197
|
exports.foldLeftWithIndex = foldLeftWithIndex;
|
|
226
198
|
const foldLeft = foldLeft_1;
|
|
227
199
|
exports.foldLeft = foldLeft;
|
|
228
|
-
const
|
|
229
|
-
exports.
|
|
200
|
+
const audit = audit_1;
|
|
201
|
+
exports.audit = audit;
|
|
230
202
|
const catchAllCause = catchAllCause_1;
|
|
231
203
|
exports.catchAllCause = catchAllCause;
|
|
232
204
|
const concatAll = concatAll_1;
|
|
233
205
|
exports.concatAll = concatAll;
|
|
234
|
-
const
|
|
235
|
-
exports.
|
|
206
|
+
const concat = concat_1;
|
|
207
|
+
exports.concat = concat;
|
|
236
208
|
const countWithIndex = countWithIndex_1;
|
|
237
209
|
exports.countWithIndex = countWithIndex;
|
|
238
|
-
const
|
|
239
|
-
exports.
|
|
210
|
+
const zipLatest = zipLatest_1;
|
|
211
|
+
exports.zipLatest = zipLatest;
|
|
240
212
|
const delayWithIndex = delayWithIndex_1;
|
|
241
213
|
exports.delayWithIndex = delayWithIndex;
|
|
242
|
-
const
|
|
243
|
-
exports.
|
|
214
|
+
const delayWith = delayWith_1;
|
|
215
|
+
exports.delayWith = delayWith;
|
|
244
216
|
const exhaustMapWithIndex = exhaustMapWithIndex_1;
|
|
245
217
|
exports.exhaustMapWithIndex = exhaustMapWithIndex;
|
|
246
218
|
const expandWithIndex = expandWithIndex_1;
|
|
@@ -249,35 +221,34 @@ const findWithIndex = findWithIndex_1;
|
|
|
249
221
|
exports.findWithIndex = findWithIndex;
|
|
250
222
|
const findIndexWithIndex = findIndexWithIndex_1;
|
|
251
223
|
exports.findIndexWithIndex = findIndexWithIndex;
|
|
252
|
-
const
|
|
253
|
-
exports.
|
|
224
|
+
const mergeAll = mergeAll_1;
|
|
225
|
+
exports.mergeAll = mergeAll;
|
|
254
226
|
const mergeScanWithIndex = mergeScanWithIndex_1;
|
|
255
227
|
exports.mergeScanWithIndex = mergeScanWithIndex;
|
|
256
|
-
const
|
|
257
|
-
exports.
|
|
258
|
-
const
|
|
259
|
-
exports.
|
|
228
|
+
const onEmpty = onEmpty_1;
|
|
229
|
+
exports.onEmpty = onEmpty;
|
|
230
|
+
const sample = sample_1;
|
|
231
|
+
exports.sample = sample;
|
|
260
232
|
const scanLeftWithIndex = scanLeftWithIndex_1;
|
|
261
233
|
exports.scanLeftWithIndex = scanLeftWithIndex;
|
|
262
234
|
const serviceWithObservable = serviceWithObservable_1;
|
|
263
235
|
exports.serviceWithObservable = serviceWithObservable;
|
|
264
236
|
const switchMapWithIndex = switchMapWithIndex_1;
|
|
265
237
|
exports.switchMapWithIndex = switchMapWithIndex;
|
|
266
|
-
const
|
|
267
|
-
exports.
|
|
238
|
+
const switchMap = switchMap_1;
|
|
239
|
+
exports.switchMap = switchMap;
|
|
268
240
|
const switchScanWithIndex = switchScanWithIndex_1;
|
|
269
241
|
exports.switchScanWithIndex = switchScanWithIndex;
|
|
270
|
-
const
|
|
271
|
-
exports.
|
|
242
|
+
const take = take_1;
|
|
243
|
+
exports.take = take;
|
|
272
244
|
const takeWhileWithIndex = takeWhileWithIndex_1;
|
|
273
245
|
exports.takeWhileWithIndex = takeWhileWithIndex;
|
|
274
|
-
const
|
|
275
|
-
exports.
|
|
246
|
+
const throttle = throttle_1;
|
|
247
|
+
exports.throttle = throttle;
|
|
276
248
|
const toArray = toArray_1;
|
|
277
249
|
exports.toArray = toArray;
|
|
278
|
-
const
|
|
279
|
-
exports.
|
|
280
|
-
|
|
250
|
+
const uniqueUntilChanged = uniqueUntilChanged_1;
|
|
251
|
+
exports.uniqueUntilChanged = uniqueUntilChanged;
|
|
281
252
|
/**
|
|
282
253
|
* @tsplus static fncts.observable.ObservableOps halt
|
|
283
254
|
*/
|
|
@@ -287,116 +258,89 @@ function halt(defect) {
|
|
|
287
258
|
/**
|
|
288
259
|
* @tsplus static fncts.observable.ObservableOps defer
|
|
289
260
|
*/
|
|
290
|
-
|
|
291
|
-
|
|
292
261
|
function defer_1(observable) {
|
|
293
|
-
return new _definition2.Observable(s => {
|
|
294
|
-
from_1(observable()).subscribe(s);
|
|
262
|
+
return new _definition2.Observable((s, environment) => {
|
|
263
|
+
from_1(observable()).provideEnvironment(environment).subscribe(s);
|
|
295
264
|
});
|
|
296
265
|
}
|
|
297
266
|
/**
|
|
298
267
|
* @tsplus static fncts.observable.ObservableOps empty
|
|
299
268
|
*/
|
|
300
|
-
|
|
301
|
-
|
|
302
269
|
function empty_1() {
|
|
303
270
|
return _definition2.EMPTY;
|
|
304
271
|
}
|
|
305
272
|
/**
|
|
306
273
|
* @tsplus static fncts.observable.ObservableOps environmentWithObservable
|
|
307
274
|
*/
|
|
308
|
-
|
|
309
|
-
|
|
310
275
|
function environmentWithObservable_1(f) {
|
|
311
276
|
return new _definition2.EnvironmentWith(f);
|
|
312
277
|
}
|
|
313
278
|
/**
|
|
314
279
|
* @tsplus static fncts.observable.ObservableOps failCause
|
|
315
280
|
*/
|
|
316
|
-
|
|
317
|
-
|
|
318
281
|
function failCause(cause) {
|
|
319
282
|
return new _definition2.Observable(s => s.error(cause));
|
|
320
283
|
}
|
|
321
284
|
/**
|
|
322
285
|
* @tsplus static fncts.observable.ObservableOps fail
|
|
323
286
|
*/
|
|
324
|
-
|
|
325
|
-
|
|
326
287
|
function fail_1(e) {
|
|
327
288
|
return new _definition2.Observable(s => s.error(tsplus_module_1.fail(e)));
|
|
328
289
|
}
|
|
329
290
|
/**
|
|
330
291
|
* @tsplus static fncts.observable.ObservableOps from
|
|
331
292
|
*/
|
|
332
|
-
|
|
333
|
-
|
|
334
293
|
function from_1(input) {
|
|
335
294
|
if (input instanceof _definition2.Observable) {
|
|
336
295
|
return input;
|
|
337
296
|
}
|
|
338
|
-
|
|
339
297
|
if (tsplus_module_2.isArrayLike(input)) {
|
|
340
298
|
return fromArrayLike(input);
|
|
341
299
|
}
|
|
342
|
-
|
|
343
300
|
if (tsplus_module_2.isPromiseLike(input)) {
|
|
344
301
|
return fromPromise(input);
|
|
345
302
|
}
|
|
346
|
-
|
|
347
303
|
if (tsplus_module_2.isAsyncIterable(input)) {
|
|
348
304
|
return fromAsyncIterable(input);
|
|
349
305
|
}
|
|
350
|
-
|
|
351
306
|
if (tsplus_module_3.isIterable(input)) {
|
|
352
307
|
return fromIterable(input);
|
|
353
308
|
}
|
|
354
|
-
|
|
355
309
|
if (tsplus_module_2.isReadableStream(input)) {
|
|
356
310
|
return fromReadableStreamLike(input);
|
|
357
311
|
}
|
|
358
|
-
|
|
359
312
|
if (tsplus_module_4.isIO(input)) {
|
|
360
313
|
return fromIO_1(input);
|
|
361
314
|
}
|
|
362
|
-
|
|
363
315
|
if ("subscribe" in input) {
|
|
364
316
|
return fromSubscribable_1(input);
|
|
365
317
|
}
|
|
366
|
-
|
|
367
318
|
throw new TypeError("Invalid Observable input");
|
|
368
319
|
}
|
|
369
|
-
|
|
370
320
|
function fromArrayLike(input) {
|
|
371
321
|
return new _definition2.Observable(s => {
|
|
372
322
|
for (let i = 0; i < input.length && !s.closed; i++) {
|
|
373
323
|
s.next(input[i]);
|
|
374
324
|
}
|
|
375
|
-
|
|
376
325
|
s.complete();
|
|
377
326
|
});
|
|
378
327
|
}
|
|
379
|
-
|
|
380
328
|
function fromAsyncIterable(asyncIterable) {
|
|
381
329
|
return new _definition2.Observable(s => {
|
|
382
330
|
process(asyncIterable, s).catch(err => s.error(tsplus_module_1.halt(err)));
|
|
383
331
|
});
|
|
384
332
|
}
|
|
385
|
-
|
|
386
333
|
function fromIterable(iterable) {
|
|
387
334
|
return new _definition2.Observable(s => {
|
|
388
335
|
for (const value of iterable) {
|
|
389
336
|
s.next(value);
|
|
390
|
-
|
|
391
337
|
if (s.closed) {
|
|
392
338
|
return;
|
|
393
339
|
}
|
|
394
340
|
}
|
|
395
|
-
|
|
396
341
|
s.complete();
|
|
397
342
|
});
|
|
398
343
|
}
|
|
399
|
-
|
|
400
344
|
function fromPromise(promise) {
|
|
401
345
|
return new _definition2.Observable(s => {
|
|
402
346
|
promise.then(value => {
|
|
@@ -407,19 +351,15 @@ function fromPromise(promise) {
|
|
|
407
351
|
}, err => s.error(tsplus_module_1.halt(err))).then(null, tsplus_module_2.reportUnhandledError);
|
|
408
352
|
});
|
|
409
353
|
}
|
|
410
|
-
|
|
411
354
|
function fromReadableStreamLike(readableStream) {
|
|
412
355
|
return fromAsyncIterable((0, tsplus_module_2.readableStreamToAsyncGenerator)(readableStream));
|
|
413
356
|
}
|
|
414
357
|
/**
|
|
415
358
|
* @tsplus static fncts.observable.ObservableOps fromSubscribable
|
|
416
359
|
*/
|
|
417
|
-
|
|
418
|
-
|
|
419
360
|
function fromSubscribable_1(subscribable) {
|
|
420
361
|
return new _definition2.Observable(subscriber => subscribable.subscribe(subscriber));
|
|
421
362
|
}
|
|
422
|
-
|
|
423
363
|
function fromInterop(subscribable) {
|
|
424
364
|
return new _definition2.Observable(subscriber => subscribable.subscribe({
|
|
425
365
|
next: value => subscriber.next(value),
|
|
@@ -427,11 +367,9 @@ function fromInterop(subscribable) {
|
|
|
427
367
|
complete: () => subscriber.complete()
|
|
428
368
|
}));
|
|
429
369
|
}
|
|
430
|
-
|
|
431
370
|
function _if(condition, onTrue, onFalse) {
|
|
432
371
|
return defer_1(() => condition() ? onTrue : onFalse);
|
|
433
372
|
}
|
|
434
|
-
|
|
435
373
|
function iterate(options) {
|
|
436
374
|
const {
|
|
437
375
|
initialState,
|
|
@@ -439,58 +377,45 @@ function iterate(options) {
|
|
|
439
377
|
iterate,
|
|
440
378
|
scheduler
|
|
441
379
|
} = options;
|
|
442
|
-
|
|
443
380
|
function* gen() {
|
|
444
381
|
for (let state = initialState; !cont || cont(state); state = iterate(state)) {
|
|
445
382
|
yield state;
|
|
446
383
|
}
|
|
447
384
|
}
|
|
448
|
-
|
|
449
385
|
return defer_1(scheduler ? () => scheduleIterable(gen(), scheduler) : gen);
|
|
450
386
|
}
|
|
451
|
-
|
|
452
387
|
async function process(asyncIterable, subscriber) {
|
|
453
388
|
for await (const value of asyncIterable) {
|
|
454
389
|
subscriber.next(value);
|
|
455
|
-
|
|
456
390
|
if (subscriber.closed) {
|
|
457
391
|
return;
|
|
458
392
|
}
|
|
459
393
|
}
|
|
460
|
-
|
|
461
394
|
subscriber.complete();
|
|
462
395
|
}
|
|
463
396
|
/**
|
|
464
397
|
* @tsplus static fncts.obervable.ObservableOps interval
|
|
465
398
|
*/
|
|
466
|
-
|
|
467
|
-
|
|
468
399
|
function interval_1(period = 0, scheduler = tsplus_module_5.asyncScheduler) {
|
|
469
400
|
if (period < 0) {
|
|
470
401
|
// eslint-disable-next-line no-param-reassign
|
|
471
402
|
period = 0;
|
|
472
403
|
}
|
|
473
|
-
|
|
474
404
|
return timer_1(period, period, scheduler);
|
|
475
405
|
}
|
|
476
|
-
|
|
477
406
|
function merge(...sources) {
|
|
478
407
|
const concurrency = (0, _args.popNumber)(sources, Infinity);
|
|
479
|
-
return !sources.length ? empty_1() : sources.length === 1 ? from_1(sources[0]) : mergeAll_1(fromArrayLike(sources)
|
|
408
|
+
return !sources.length ? empty_1() : sources.length === 1 ? from_1(sources[0]) : mergeAll_1(concurrency)(fromArrayLike(sources));
|
|
480
409
|
}
|
|
481
410
|
/**
|
|
482
411
|
* @tsplus static fncts.observable.ObservableOps of
|
|
483
412
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
486
413
|
function of_1(...items) {
|
|
487
414
|
return fromArrayLike(items);
|
|
488
415
|
}
|
|
489
416
|
/**
|
|
490
417
|
* @tsplus static fncts.observable.ObservableOps single
|
|
491
418
|
*/
|
|
492
|
-
|
|
493
|
-
|
|
494
419
|
function single_1(a) {
|
|
495
420
|
return new _definition2.Observable(s => {
|
|
496
421
|
s.next(a);
|
|
@@ -498,35 +423,29 @@ function single_1(a) {
|
|
|
498
423
|
});
|
|
499
424
|
}
|
|
500
425
|
/**
|
|
501
|
-
* @tsplus
|
|
426
|
+
* @tsplus pipeable fncts.observable.Observable scheduled
|
|
502
427
|
* @tsplus static fncts.observable.ObservableOps scheduled
|
|
503
428
|
*/
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (tsplus_module_2.isReadableStream(input)) {
|
|
524
|
-
return scheduleReadableStreamLike(input, scheduler);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
return scheduleObservable(from_1(input), scheduler);
|
|
429
|
+
function scheduled_1(scheduler) {
|
|
430
|
+
return input => {
|
|
431
|
+
if (tsplus_module_2.isArrayLike(input)) {
|
|
432
|
+
return scheduleArray(input, scheduler);
|
|
433
|
+
}
|
|
434
|
+
if (tsplus_module_2.isPromiseLike(input)) {
|
|
435
|
+
return schedulePromise(input, scheduler);
|
|
436
|
+
}
|
|
437
|
+
if (tsplus_module_3.isIterable(input)) {
|
|
438
|
+
return scheduleIterable(input, scheduler);
|
|
439
|
+
}
|
|
440
|
+
if (tsplus_module_2.isAsyncIterable(input)) {
|
|
441
|
+
return scheduleAsyncIterable(input, scheduler);
|
|
442
|
+
}
|
|
443
|
+
if (tsplus_module_2.isReadableStream(input)) {
|
|
444
|
+
return scheduleReadableStreamLike(input, scheduler);
|
|
445
|
+
}
|
|
446
|
+
return scheduleObservable(from_1(input), scheduler);
|
|
447
|
+
};
|
|
528
448
|
}
|
|
529
|
-
|
|
530
449
|
function scheduleArray(input, scheduler) {
|
|
531
450
|
return new _definition2.Observable(s => {
|
|
532
451
|
let i = 0;
|
|
@@ -535,7 +454,6 @@ function scheduleArray(input, scheduler) {
|
|
|
535
454
|
s.complete();
|
|
536
455
|
} else {
|
|
537
456
|
s.next(input[i++]);
|
|
538
|
-
|
|
539
457
|
if (!s.closed) {
|
|
540
458
|
this.schedule();
|
|
541
459
|
}
|
|
@@ -543,7 +461,6 @@ function scheduleArray(input, scheduler) {
|
|
|
543
461
|
});
|
|
544
462
|
});
|
|
545
463
|
}
|
|
546
|
-
|
|
547
464
|
function scheduleAsyncIterable(input, scheduler) {
|
|
548
465
|
return new _definition2.Observable(subscriber => {
|
|
549
466
|
const sub = new tsplus_module_6.Subscription();
|
|
@@ -563,7 +480,6 @@ function scheduleAsyncIterable(input, scheduler) {
|
|
|
563
480
|
return sub;
|
|
564
481
|
});
|
|
565
482
|
}
|
|
566
|
-
|
|
567
483
|
function scheduleIterable(input, scheduler) {
|
|
568
484
|
return new _definition2.Observable(s => {
|
|
569
485
|
let iterator;
|
|
@@ -574,7 +490,6 @@ function scheduleIterable(input, scheduler) {
|
|
|
574
490
|
value,
|
|
575
491
|
done
|
|
576
492
|
} = iterator.next();
|
|
577
|
-
|
|
578
493
|
if (done) {
|
|
579
494
|
s.complete();
|
|
580
495
|
} else {
|
|
@@ -586,12 +501,11 @@ function scheduleIterable(input, scheduler) {
|
|
|
586
501
|
return () => tsplus_module_3.isFunction(iterator?.return) && iterator.return();
|
|
587
502
|
});
|
|
588
503
|
}
|
|
589
|
-
|
|
590
504
|
function scheduleObservable(input, scheduler) {
|
|
591
|
-
return new _definition2.Observable(subscriber => {
|
|
505
|
+
return new _definition2.Observable((subscriber, environment) => {
|
|
592
506
|
const sub = new tsplus_module_6.Subscription();
|
|
593
507
|
sub.add(scheduler.schedule(() => {
|
|
594
|
-
sub.add(input.subscribe({
|
|
508
|
+
sub.add(input.provideEnvironment(environment).subscribe({
|
|
595
509
|
next: value => {
|
|
596
510
|
sub.add(scheduler.schedule(() => subscriber.next(value)));
|
|
597
511
|
},
|
|
@@ -605,7 +519,6 @@ function scheduleObservable(input, scheduler) {
|
|
|
605
519
|
}));
|
|
606
520
|
});
|
|
607
521
|
}
|
|
608
|
-
|
|
609
522
|
function schedulePromise(input, scheduler) {
|
|
610
523
|
return new _definition2.Observable(subscriber => {
|
|
611
524
|
return scheduler.schedule(() => {
|
|
@@ -620,14 +533,11 @@ function schedulePromise(input, scheduler) {
|
|
|
620
533
|
});
|
|
621
534
|
});
|
|
622
535
|
}
|
|
623
|
-
|
|
624
536
|
function scheduleReadableStreamLike(input, scheduler) {
|
|
625
537
|
return scheduleAsyncIterable((0, tsplus_module_2.readableStreamToAsyncGenerator)(input), scheduler);
|
|
626
538
|
}
|
|
627
|
-
|
|
628
539
|
function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyncScheduler) {
|
|
629
540
|
let intervalDuration = -1;
|
|
630
|
-
|
|
631
541
|
if (intervalOrScheduler != null) {
|
|
632
542
|
if (tsplus_module_7.isScheduler(intervalOrScheduler)) {
|
|
633
543
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -636,19 +546,15 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyn
|
|
|
636
546
|
intervalDuration = intervalOrScheduler;
|
|
637
547
|
}
|
|
638
548
|
}
|
|
639
|
-
|
|
640
549
|
return new _definition2.Observable(s => {
|
|
641
550
|
let due = tsplus_module_2.isValidDate(time) ? +time - scheduler.now() : time;
|
|
642
|
-
|
|
643
551
|
if (due < 0) {
|
|
644
552
|
due = 0;
|
|
645
553
|
}
|
|
646
|
-
|
|
647
554
|
let n = 0;
|
|
648
555
|
return scheduler.schedule(function () {
|
|
649
556
|
if (!s.closed) {
|
|
650
557
|
s.next(n++);
|
|
651
|
-
|
|
652
558
|
if (0 <= intervalDuration) {
|
|
653
559
|
this.schedule(undefined, intervalDuration);
|
|
654
560
|
} else {
|
|
@@ -661,25 +567,20 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyn
|
|
|
661
567
|
/**
|
|
662
568
|
* @tsplus static fncts.observable.ObservableOps zip
|
|
663
569
|
*/
|
|
664
|
-
|
|
665
|
-
|
|
666
570
|
function makeZip(...sources) {
|
|
667
|
-
return sources.length ? new _definition2.Observable(subscriber => {
|
|
571
|
+
return sources.length ? new _definition2.Observable((subscriber, environment) => {
|
|
668
572
|
let buffers = sources.map(() => []);
|
|
669
573
|
let completed = sources.map(() => false);
|
|
670
574
|
subscriber.add(() => {
|
|
671
575
|
buffers = completed = null;
|
|
672
576
|
});
|
|
673
|
-
|
|
674
577
|
for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
|
|
675
|
-
from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
578
|
+
from_1(sources[sourceIndex]).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
676
579
|
next: value => {
|
|
677
580
|
buffers[sourceIndex].push(value);
|
|
678
|
-
|
|
679
581
|
if (buffers.every(buffer => buffer.length)) {
|
|
680
582
|
const result = buffers.map(buffer => buffer.shift());
|
|
681
583
|
subscriber.next(result);
|
|
682
|
-
|
|
683
584
|
if (buffers.some((buffer, i) => !buffer.length && completed[i])) {
|
|
684
585
|
subscriber.complete();
|
|
685
586
|
}
|
|
@@ -691,7 +592,6 @@ function makeZip(...sources) {
|
|
|
691
592
|
}
|
|
692
593
|
}));
|
|
693
594
|
}
|
|
694
|
-
|
|
695
595
|
return () => {
|
|
696
596
|
buffers = completed = null;
|
|
697
597
|
};
|
|
@@ -700,830 +600,779 @@ function makeZip(...sources) {
|
|
|
700
600
|
/**
|
|
701
601
|
* @tsplus static fncts.observable.ObservableOps fromIO
|
|
702
602
|
*/
|
|
703
|
-
|
|
704
|
-
|
|
705
603
|
function fromIO_1(io, scheduler = tsplus_module_5.asyncScheduler) {
|
|
706
604
|
return new _definition2.Observable((s, env) => {
|
|
707
605
|
let fiber;
|
|
708
606
|
const scheduled = scheduler.schedule(() => {
|
|
709
|
-
fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.
|
|
710
|
-
fiber.
|
|
607
|
+
fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.provideEnvironment(env, fileName_1 + ":489:36")(io), fileName_1 + ":489:56");
|
|
608
|
+
fiber.addObserver(exit => {
|
|
711
609
|
if (!s.closed) {
|
|
712
|
-
tsplus_module_11.
|
|
610
|
+
tsplus_module_11.match(cause => s.error(cause), a => s.next(a))(exit);
|
|
713
611
|
s.complete();
|
|
714
612
|
}
|
|
715
613
|
});
|
|
716
614
|
});
|
|
717
615
|
return () => {
|
|
718
616
|
scheduled.unsubscribe();
|
|
719
|
-
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber
|
|
617
|
+
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber), fileName_1 + ":502:46");
|
|
720
618
|
};
|
|
721
619
|
});
|
|
722
620
|
}
|
|
723
621
|
/**
|
|
724
622
|
* @tsplus static fncts.observable.ObservableOps unit
|
|
725
623
|
*/
|
|
726
|
-
|
|
727
|
-
|
|
728
624
|
const unit = /*#__PURE__*/single_1(undefined);
|
|
729
625
|
/**
|
|
730
|
-
* @tsplus
|
|
626
|
+
* @tsplus pipeable fncts.observable.Observable zipWith
|
|
731
627
|
*/
|
|
732
|
-
|
|
733
628
|
exports.unit = unit;
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
629
|
+
function zipWith_1(fb, f) {
|
|
630
|
+
return fa => {
|
|
631
|
+
return mergeMap_1(a => map_1(b => f(a, b))(fb))(fa);
|
|
632
|
+
};
|
|
737
633
|
}
|
|
738
634
|
/**
|
|
739
|
-
* @tsplus
|
|
635
|
+
* @tsplus pipeable fncts.observable.Observable zip
|
|
740
636
|
*/
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
637
|
+
function zip(fb) {
|
|
638
|
+
return fa => {
|
|
639
|
+
return zipWith_1(fb, tsplus_module_13.tuple)(fa);
|
|
640
|
+
};
|
|
745
641
|
}
|
|
746
642
|
/**
|
|
747
|
-
* @tsplus
|
|
643
|
+
* @tsplus pipeable fncts.observable.Observable ap
|
|
748
644
|
*/
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
645
|
+
function ap(fa) {
|
|
646
|
+
return fab => {
|
|
647
|
+
return zipWith_1(fa, (f, a) => f(a))(fab);
|
|
648
|
+
};
|
|
753
649
|
}
|
|
754
650
|
/**
|
|
755
|
-
* @tsplus
|
|
651
|
+
* @tsplus pipeable fncts.observable.Observable mapWithIndex
|
|
756
652
|
*/
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
}));
|
|
767
|
-
}
|
|
653
|
+
function mapWithIndex_1(f) {
|
|
654
|
+
return fa => {
|
|
655
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
656
|
+
let i = 0;
|
|
657
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
658
|
+
next: value => {
|
|
659
|
+
subscriber.next(f(i++, value));
|
|
660
|
+
}
|
|
661
|
+
}));
|
|
662
|
+
})(fa);
|
|
663
|
+
};
|
|
768
664
|
}
|
|
769
665
|
/**
|
|
770
|
-
* @tsplus
|
|
666
|
+
* @tsplus pipeable fncts.observable.Observable map
|
|
771
667
|
*/
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
668
|
+
function map_1(f) {
|
|
669
|
+
return fa => {
|
|
670
|
+
return mapWithIndex_1((_, a) => f(a))(fa);
|
|
671
|
+
};
|
|
776
672
|
}
|
|
777
673
|
/**
|
|
778
|
-
* @tsplus
|
|
674
|
+
* @tsplus pipeable fncts.observable.Observable as
|
|
779
675
|
*/
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
676
|
+
function as_1(b) {
|
|
677
|
+
return fa => {
|
|
678
|
+
return map_1(b)(fa);
|
|
679
|
+
};
|
|
784
680
|
}
|
|
785
681
|
/**
|
|
786
|
-
* @tsplus
|
|
682
|
+
* @tsplus pipeable fncts.observable.Observable mapError
|
|
787
683
|
*/
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
}));
|
|
797
|
-
}
|
|
684
|
+
function mapError(f) {
|
|
685
|
+
return fa => {
|
|
686
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
687
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
688
|
+
error: err => {
|
|
689
|
+
subscriber.error(tsplus_module_1.map(f)(err));
|
|
690
|
+
}
|
|
691
|
+
}));
|
|
692
|
+
})(fa);
|
|
693
|
+
};
|
|
798
694
|
}
|
|
799
695
|
/**
|
|
800
696
|
* @tsplus getter fncts.observable.Observable swap
|
|
801
697
|
*/
|
|
802
|
-
|
|
803
|
-
|
|
804
698
|
function swap(fa) {
|
|
805
|
-
return tsplus_module_8.operate_(
|
|
806
|
-
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
699
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
700
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
807
701
|
next: value => {
|
|
808
702
|
subscriber.error(tsplus_module_1.fail(value));
|
|
809
703
|
},
|
|
810
704
|
error: err => {
|
|
811
|
-
tsplus_module_14.
|
|
705
|
+
tsplus_module_14.match(e => {
|
|
812
706
|
subscriber.next(e);
|
|
813
707
|
}, cause => {
|
|
814
708
|
subscriber.error(cause);
|
|
815
|
-
});
|
|
709
|
+
})(tsplus_module_1.failureOrCause(err));
|
|
816
710
|
}
|
|
817
711
|
}));
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
712
|
+
})(fa);
|
|
713
|
+
}
|
|
714
|
+
function filterWithIndex_1(predicate) {
|
|
715
|
+
return fa => {
|
|
716
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
717
|
+
let index = 0;
|
|
718
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
719
|
+
next: value => predicate(index++, value) && subscriber.next(value)
|
|
720
|
+
}));
|
|
721
|
+
})(fa);
|
|
722
|
+
};
|
|
828
723
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
724
|
+
function filter(predicate) {
|
|
725
|
+
return fa => {
|
|
726
|
+
return filterWithIndex_1((_, a) => predicate(a))(fa);
|
|
727
|
+
};
|
|
832
728
|
}
|
|
833
729
|
/**
|
|
834
|
-
* @tsplus
|
|
730
|
+
* @tsplus pipeable fncts.observable.Observable filterMapWithIndex
|
|
835
731
|
*/
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}));
|
|
844
|
-
}
|
|
732
|
+
function filterMapWithIndex_1(f) {
|
|
733
|
+
return fa => {
|
|
734
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
735
|
+
let index = 0;
|
|
736
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
737
|
+
next: value => tsplus_module_15.match(() => tsplus_module_2.noop, b => subscriber.next(b))(f(index++, value))
|
|
738
|
+
}));
|
|
739
|
+
})(fa);
|
|
740
|
+
};
|
|
845
741
|
}
|
|
846
742
|
/**
|
|
847
|
-
* @tsplus
|
|
743
|
+
* @tsplus pipeable fncts.observable.Observable filterMap
|
|
848
744
|
*/
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
function partitionWithIndex_1(fa, predicate) {
|
|
856
|
-
return [filterWithIndex_1(fa, (i, a) => !predicate(i, a)), filterWithIndex_1(fa, predicate)];
|
|
745
|
+
function filterMap(f) {
|
|
746
|
+
return fa => {
|
|
747
|
+
return filterMapWithIndex_1((_, a) => f(a))(fa);
|
|
748
|
+
};
|
|
857
749
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
750
|
+
function partitionWithIndex_1(predicate) {
|
|
751
|
+
return fa => {
|
|
752
|
+
return [filterWithIndex_1((i, a) => !predicate(i, a))(fa), filterWithIndex_1(predicate)(fa)];
|
|
753
|
+
};
|
|
861
754
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
function partitionMapWithIndex_1(fa, f) {
|
|
868
|
-
return [tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
869
|
-
let index = 0;
|
|
870
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
871
|
-
next: value => {
|
|
872
|
-
tsplus_module_14.match_(f(index++, value), b => subscriber.next(b), tsplus_module_2.noop);
|
|
873
|
-
}
|
|
874
|
-
}));
|
|
875
|
-
}), tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
876
|
-
let index = 0;
|
|
877
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
878
|
-
next: value => {
|
|
879
|
-
tsplus_module_14.match_(f(index++, value), tsplus_module_2.noop, c => subscriber.next(c));
|
|
880
|
-
}
|
|
881
|
-
}));
|
|
882
|
-
})];
|
|
755
|
+
function partition(predicate) {
|
|
756
|
+
return fa => {
|
|
757
|
+
return partitionWithIndex_1((_, a) => predicate(a))(fa);
|
|
758
|
+
};
|
|
883
759
|
}
|
|
884
760
|
/**
|
|
885
|
-
* @tsplus
|
|
761
|
+
* @tsplus pipeable fncts.observable.Observable partitionMapWithIndex
|
|
886
762
|
*/
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
763
|
+
function partitionMapWithIndex_1(f) {
|
|
764
|
+
return fa => {
|
|
765
|
+
return [tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
766
|
+
let index = 0;
|
|
767
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
768
|
+
next: value => {
|
|
769
|
+
tsplus_module_14.match(b => subscriber.next(b), tsplus_module_2.noop)(f(index++, value));
|
|
770
|
+
}
|
|
771
|
+
}));
|
|
772
|
+
})(fa), tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
773
|
+
let index = 0;
|
|
774
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
775
|
+
next: value => {
|
|
776
|
+
tsplus_module_14.match(tsplus_module_2.noop, c => subscriber.next(c))(f(index++, value));
|
|
777
|
+
}
|
|
778
|
+
}));
|
|
779
|
+
})(fa)];
|
|
780
|
+
};
|
|
891
781
|
}
|
|
892
782
|
/**
|
|
893
|
-
* @tsplus
|
|
783
|
+
* @tsplus pipeable fncts.observable.Observable partitionMap
|
|
894
784
|
*/
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
785
|
+
function partitionMap(f) {
|
|
786
|
+
return fa => {
|
|
787
|
+
return partitionMapWithIndex_1((_, a) => f(a))(fa);
|
|
788
|
+
};
|
|
899
789
|
}
|
|
900
790
|
/**
|
|
901
|
-
* @tsplus
|
|
791
|
+
* @tsplus pipeable fncts.observable.Observable provideService
|
|
902
792
|
*/
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
tag) {
|
|
908
|
-
return contramapEnvironment_1(self, environment => tsplus_module_16.add(environment, service, tag));
|
|
793
|
+
function provideService(service, /** @tsplus auto */tag) {
|
|
794
|
+
return self => {
|
|
795
|
+
return contramapEnvironment_1(environment => tsplus_module_16.add(service, tag)(environment))(self);
|
|
796
|
+
};
|
|
909
797
|
}
|
|
910
798
|
/**
|
|
911
|
-
* @tsplus
|
|
799
|
+
* @tsplus pipeable fncts.observable.Observable mergeMapWithIndex
|
|
912
800
|
*/
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
801
|
+
function mergeMapWithIndex_1(f, concurrent = Infinity) {
|
|
802
|
+
return ma => {
|
|
803
|
+
return tsplus_module_8.operate_((source, sub, environment) => mergeInternal(source, sub, environment, f, concurrent))(ma);
|
|
804
|
+
};
|
|
917
805
|
}
|
|
918
806
|
/**
|
|
919
|
-
* @tsplus
|
|
807
|
+
* @tsplus pipeable fncts.observable.Observable mergeMap
|
|
920
808
|
*/
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
809
|
+
function mergeMap_1(f, concurrent = Infinity) {
|
|
810
|
+
return ma => {
|
|
811
|
+
return mergeMapWithIndex_1((_, a) => f(a), concurrent)(ma);
|
|
812
|
+
};
|
|
925
813
|
}
|
|
926
814
|
/**
|
|
927
|
-
* @tsplus
|
|
815
|
+
* @tsplus pipeable fncts.observable.Observable concatMapWithIndex
|
|
928
816
|
*/
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
817
|
+
function concatMapWithIndex(f) {
|
|
818
|
+
return ma => {
|
|
819
|
+
return mergeMapWithIndex_1(f, 1)(ma);
|
|
820
|
+
};
|
|
933
821
|
}
|
|
934
822
|
/**
|
|
935
|
-
* @tsplus
|
|
823
|
+
* @tsplus pipeable fncts.observable.Observable concatMap
|
|
936
824
|
*/
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
825
|
+
function concatMap(f) {
|
|
826
|
+
return ma => {
|
|
827
|
+
return mergeMapWithIndex_1((_, a) => f(a), 1)(ma);
|
|
828
|
+
};
|
|
941
829
|
}
|
|
942
830
|
/**
|
|
943
|
-
* @tsplus
|
|
831
|
+
* @tsplus pipeable fncts.observable.Observable contramapEnvironment
|
|
944
832
|
*/
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
833
|
+
function contramapEnvironment_1(f) {
|
|
834
|
+
return self => {
|
|
835
|
+
return environmentWithObservable_1(environment => self.provideEnvironment(f(environment)));
|
|
836
|
+
};
|
|
949
837
|
}
|
|
950
838
|
/**
|
|
951
839
|
* @tsplus getter fncts.observable.Observable flatten
|
|
952
840
|
*/
|
|
953
|
-
|
|
954
|
-
|
|
955
841
|
function flatten(mma) {
|
|
956
842
|
return concatAll_1(mma);
|
|
957
843
|
}
|
|
958
844
|
/**
|
|
959
|
-
* @tsplus
|
|
845
|
+
* @tsplus pipeable fncts.observable.Observable foldLeftWithIndex
|
|
960
846
|
*/
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
847
|
+
function foldLeftWithIndex_1(initial, f) {
|
|
848
|
+
return fa => {
|
|
849
|
+
return tsplus_module_8.operate_(scanInternal(f, initial, true, false, true))(fa);
|
|
850
|
+
};
|
|
965
851
|
}
|
|
966
852
|
/**
|
|
967
|
-
* @tsplus
|
|
853
|
+
* @tsplus pipeable fncts.observable.Observable foldLeft
|
|
968
854
|
*/
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
855
|
+
function foldLeft_1(initial, f) {
|
|
856
|
+
return fa => {
|
|
857
|
+
return foldLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
858
|
+
};
|
|
973
859
|
}
|
|
974
860
|
/**
|
|
975
|
-
* @tsplus
|
|
861
|
+
* @tsplus pipeable fncts.observable.Observable at
|
|
976
862
|
*/
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
863
|
+
function at(index) {
|
|
864
|
+
return fa => {
|
|
865
|
+
return onEmpty_1(() => tsplus_module_17.nothing())(map_1(tsplus_module_17.just)(take_1(1)(filterWithIndex_1(i => i === index)(fa))));
|
|
866
|
+
};
|
|
981
867
|
}
|
|
982
868
|
/**
|
|
983
|
-
* @tsplus
|
|
869
|
+
* @tsplus pipeable fncts.observable.Observable audit
|
|
984
870
|
*/
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
value
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
complete: () => {
|
|
1025
|
-
isComplete = true;
|
|
1026
|
-
(tsplus_module_18.isNothing(lastValue) || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
1027
|
-
}
|
|
1028
|
-
}));
|
|
1029
|
-
});
|
|
871
|
+
function audit_1(durationSelector) {
|
|
872
|
+
return fa => {
|
|
873
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
874
|
+
let lastValue = tsplus_module_17.nothing();
|
|
875
|
+
let durationSubscriber = null;
|
|
876
|
+
let isComplete = false;
|
|
877
|
+
const endDuration = () => {
|
|
878
|
+
durationSubscriber?.unsubscribe();
|
|
879
|
+
durationSubscriber = null;
|
|
880
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
881
|
+
const {
|
|
882
|
+
value
|
|
883
|
+
} = lastValue;
|
|
884
|
+
lastValue = tsplus_module_17.nothing();
|
|
885
|
+
subscriber.next(value);
|
|
886
|
+
}
|
|
887
|
+
isComplete && subscriber.complete();
|
|
888
|
+
};
|
|
889
|
+
const cleanupDuration = () => {
|
|
890
|
+
durationSubscriber = null;
|
|
891
|
+
isComplete && subscriber.complete();
|
|
892
|
+
};
|
|
893
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
894
|
+
next: value => {
|
|
895
|
+
lastValue = tsplus_module_17.just(value);
|
|
896
|
+
if (!durationSubscriber) {
|
|
897
|
+
from_1(durationSelector(value)).provideEnvironment(environment).subscribe(durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
898
|
+
next: endDuration,
|
|
899
|
+
complete: cleanupDuration
|
|
900
|
+
}));
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
complete: () => {
|
|
904
|
+
isComplete = true;
|
|
905
|
+
(tsplus_module_18.isNothing(lastValue) || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
906
|
+
}
|
|
907
|
+
}));
|
|
908
|
+
})(fa);
|
|
909
|
+
};
|
|
1030
910
|
}
|
|
1031
911
|
/**
|
|
1032
|
-
* @tsplus
|
|
912
|
+
* @tsplus pipeable fncts.observable.Observable auditTime
|
|
1033
913
|
*/
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
914
|
+
function auditTime(duration, scheduler = tsplus_module_5.asyncScheduler) {
|
|
915
|
+
return fa => {
|
|
916
|
+
return audit_1(() => timer_1(duration, scheduler))(fa);
|
|
917
|
+
};
|
|
1038
918
|
}
|
|
1039
919
|
/**
|
|
1040
|
-
* @tsplus
|
|
920
|
+
* @tsplus pipeable fncts.observable.Observable buffer
|
|
1041
921
|
*/
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
};
|
|
1065
|
-
}
|
|
922
|
+
function buffer(closingNotifier) {
|
|
923
|
+
return fa => {
|
|
924
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
925
|
+
let buffer = [];
|
|
926
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
927
|
+
next: value => buffer.push(value),
|
|
928
|
+
complete: () => {
|
|
929
|
+
subscriber.next(buffer);
|
|
930
|
+
subscriber.complete();
|
|
931
|
+
}
|
|
932
|
+
}));
|
|
933
|
+
closingNotifier.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
934
|
+
next: () => {
|
|
935
|
+
const b = buffer;
|
|
936
|
+
buffer = [];
|
|
937
|
+
subscriber.next(b);
|
|
938
|
+
},
|
|
939
|
+
complete: tsplus_module_2.noop
|
|
940
|
+
}));
|
|
941
|
+
return () => {
|
|
942
|
+
buffer = null;
|
|
943
|
+
};
|
|
944
|
+
})(fa);
|
|
945
|
+
};
|
|
1066
946
|
}
|
|
1067
947
|
/**
|
|
1068
|
-
* @tsplus
|
|
948
|
+
* @tsplus pipeable fncts.observable.Observable bufferCount
|
|
1069
949
|
*/
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (count++ % startBufferEvery === 0) {
|
|
1083
|
-
buffers.push([]);
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
for (const buffer of buffers) {
|
|
1087
|
-
buffer.push(value);
|
|
1088
|
-
|
|
1089
|
-
if (bufferSize <= buffer.length) {
|
|
1090
|
-
toEmit = toEmit ?? [];
|
|
1091
|
-
toEmit.push(buffer);
|
|
950
|
+
function bufferCount(bufferSize, startBufferEvery) {
|
|
951
|
+
return fa => {
|
|
952
|
+
// eslint-disable-next-line no-param-reassign
|
|
953
|
+
startBufferEvery = startBufferEvery ?? bufferSize;
|
|
954
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
955
|
+
let buffers = [];
|
|
956
|
+
let count = 0;
|
|
957
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
958
|
+
next: value => {
|
|
959
|
+
let toEmit = null;
|
|
960
|
+
if (count++ % startBufferEvery === 0) {
|
|
961
|
+
buffers.push([]);
|
|
1092
962
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
963
|
+
for (const buffer of buffers) {
|
|
964
|
+
buffer.push(value);
|
|
965
|
+
if (bufferSize <= buffer.length) {
|
|
966
|
+
toEmit = toEmit ?? [];
|
|
967
|
+
toEmit.push(buffer);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
if (toEmit) {
|
|
971
|
+
for (const buffer of toEmit) {
|
|
972
|
+
(0, tsplus_module_2.arrayRemove)(buffers, buffer);
|
|
973
|
+
subscriber.next(buffer);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
complete: () => {
|
|
978
|
+
for (const buffer of buffers) {
|
|
1098
979
|
subscriber.next(buffer);
|
|
1099
980
|
}
|
|
981
|
+
subscriber.complete();
|
|
1100
982
|
}
|
|
1101
|
-
},
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
subscriber.complete();
|
|
1108
|
-
}
|
|
1109
|
-
}, () => {
|
|
1110
|
-
buffers = null;
|
|
1111
|
-
}));
|
|
1112
|
-
});
|
|
983
|
+
}, () => {
|
|
984
|
+
buffers = null;
|
|
985
|
+
}));
|
|
986
|
+
})(fa);
|
|
987
|
+
};
|
|
1113
988
|
}
|
|
1114
989
|
/**
|
|
1115
|
-
* @tsplus
|
|
990
|
+
* @tsplus pipeable fncts.observable.Observable bufferTime
|
|
1116
991
|
*/
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
const emit = record => {
|
|
1131
|
-
const {
|
|
1132
|
-
buffer,
|
|
1133
|
-
subs
|
|
1134
|
-
} = record;
|
|
1135
|
-
subs.unsubscribe();
|
|
1136
|
-
(0, tsplus_module_2.arrayRemove)(bufferRecords, record);
|
|
1137
|
-
subscriber.next(buffer);
|
|
1138
|
-
restartOnEmit && startBuffer();
|
|
1139
|
-
};
|
|
1140
|
-
|
|
1141
|
-
const startBuffer = () => {
|
|
1142
|
-
if (bufferRecords) {
|
|
1143
|
-
const subs = new tsplus_module_6.Subscription();
|
|
1144
|
-
subscriber.add(subs);
|
|
1145
|
-
const buffer = [];
|
|
1146
|
-
const record = {
|
|
992
|
+
function bufferTime(config) {
|
|
993
|
+
return fa => {
|
|
994
|
+
const {
|
|
995
|
+
bufferTimeSpan,
|
|
996
|
+
bufferCreationInterval = null,
|
|
997
|
+
maxBufferSize = Infinity,
|
|
998
|
+
scheduler = tsplus_module_5.asyncScheduler
|
|
999
|
+
} = config;
|
|
1000
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1001
|
+
let bufferRecords = [];
|
|
1002
|
+
let restartOnEmit = true;
|
|
1003
|
+
const emit = record => {
|
|
1004
|
+
const {
|
|
1147
1005
|
buffer,
|
|
1148
1006
|
subs
|
|
1149
|
-
};
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
buffer
|
|
1167
|
-
} = record;
|
|
1168
|
-
buffer.push(value);
|
|
1169
|
-
maxBufferSize <= buffer.length && emit(record);
|
|
1007
|
+
} = record;
|
|
1008
|
+
subs.unsubscribe();
|
|
1009
|
+
(0, tsplus_module_2.arrayRemove)(bufferRecords, record);
|
|
1010
|
+
subscriber.next(buffer);
|
|
1011
|
+
restartOnEmit && startBuffer();
|
|
1012
|
+
};
|
|
1013
|
+
const startBuffer = () => {
|
|
1014
|
+
if (bufferRecords) {
|
|
1015
|
+
const subs = new tsplus_module_6.Subscription();
|
|
1016
|
+
subscriber.add(subs);
|
|
1017
|
+
const buffer = [];
|
|
1018
|
+
const record = {
|
|
1019
|
+
buffer,
|
|
1020
|
+
subs
|
|
1021
|
+
};
|
|
1022
|
+
bufferRecords.push(record);
|
|
1023
|
+
subs.add(scheduler.schedule(() => emit(record), bufferTimeSpan));
|
|
1170
1024
|
}
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1025
|
+
};
|
|
1026
|
+
bufferCreationInterval !== null && bufferCreationInterval >= 0 ? subscriber.add(scheduler.schedule(function () {
|
|
1027
|
+
startBuffer();
|
|
1028
|
+
!this.closed && subscriber.add(this.schedule(null, bufferCreationInterval));
|
|
1029
|
+
}, bufferCreationInterval)) : restartOnEmit = true;
|
|
1030
|
+
startBuffer();
|
|
1031
|
+
const bufferTimeSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1032
|
+
next: value => {
|
|
1033
|
+
const recordsCopy = bufferRecords.slice();
|
|
1034
|
+
for (const record of recordsCopy) {
|
|
1035
|
+
const {
|
|
1036
|
+
buffer
|
|
1037
|
+
} = record;
|
|
1038
|
+
buffer.push(value);
|
|
1039
|
+
maxBufferSize <= buffer.length && emit(record);
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
complete: () => {
|
|
1043
|
+
while (bufferRecords?.length) {
|
|
1044
|
+
subscriber.next(bufferRecords.shift().buffer);
|
|
1045
|
+
}
|
|
1046
|
+
bufferTimeSubscriber?.unsubscribe();
|
|
1047
|
+
subscriber.complete();
|
|
1048
|
+
subscriber.unsubscribe();
|
|
1175
1049
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
}, () => bufferRecords = null);
|
|
1182
|
-
source.subscribe(bufferTimeSubscriber);
|
|
1183
|
-
});
|
|
1050
|
+
}, () => bufferRecords = null);
|
|
1051
|
+
source.provideEnvironment(environment).subscribe(bufferTimeSubscriber);
|
|
1052
|
+
})(fa);
|
|
1053
|
+
};
|
|
1184
1054
|
}
|
|
1185
1055
|
/**
|
|
1186
|
-
* @tsplus
|
|
1056
|
+
* @tsplus pipeable fncts.observable.Observable bufferToggle
|
|
1187
1057
|
*/
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
closingSubscription.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
subscriber.next(buffers.shift());
|
|
1058
|
+
function bufferToggle(openings, closingSelector) {
|
|
1059
|
+
return fa => {
|
|
1060
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1061
|
+
const buffers = [];
|
|
1062
|
+
from_1(openings).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1063
|
+
next: openValue => {
|
|
1064
|
+
const buffer = [];
|
|
1065
|
+
buffers.push(buffer);
|
|
1066
|
+
const closingSubscription = new tsplus_module_6.Subscription();
|
|
1067
|
+
const emitBuffer = () => {
|
|
1068
|
+
(0, tsplus_module_2.arrayRemove)(buffers, buffer);
|
|
1069
|
+
subscriber.next(buffer);
|
|
1070
|
+
closingSubscription.unsubscribe();
|
|
1071
|
+
};
|
|
1072
|
+
closingSubscription.add(from_1(closingSelector(openValue)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1073
|
+
next: emitBuffer,
|
|
1074
|
+
complete: tsplus_module_2.noop
|
|
1075
|
+
})));
|
|
1076
|
+
},
|
|
1077
|
+
complete: tsplus_module_2.noop
|
|
1078
|
+
}));
|
|
1079
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1080
|
+
next: value => {
|
|
1081
|
+
for (const buffer of buffers) {
|
|
1082
|
+
buffer.push(value);
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
complete: () => {
|
|
1086
|
+
while (buffers.length > 0) {
|
|
1087
|
+
subscriber.next(buffers.shift());
|
|
1088
|
+
}
|
|
1089
|
+
subscriber.complete();
|
|
1221
1090
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}));
|
|
1226
|
-
});
|
|
1091
|
+
}));
|
|
1092
|
+
})(fa);
|
|
1093
|
+
};
|
|
1227
1094
|
}
|
|
1228
1095
|
/**
|
|
1229
|
-
* @tsplus
|
|
1096
|
+
* @tsplus pipeable fncts.observable.Observable bufferWhen
|
|
1230
1097
|
*/
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}, () => buffer = closingSubscriber = null));
|
|
1257
|
-
});
|
|
1098
|
+
function bufferWhen(closingSelector) {
|
|
1099
|
+
return fa => {
|
|
1100
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1101
|
+
let buffer = null;
|
|
1102
|
+
let closingSubscriber = null;
|
|
1103
|
+
const openBuffer = () => {
|
|
1104
|
+
closingSubscriber?.unsubscribe();
|
|
1105
|
+
const b = buffer;
|
|
1106
|
+
buffer = [];
|
|
1107
|
+
b && subscriber.next(b);
|
|
1108
|
+
from_1(closingSelector()).provideEnvironment(environment).subscribe(closingSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1109
|
+
next: openBuffer,
|
|
1110
|
+
complete: tsplus_module_2.noop
|
|
1111
|
+
}));
|
|
1112
|
+
};
|
|
1113
|
+
openBuffer();
|
|
1114
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1115
|
+
next: value => buffer?.push(value),
|
|
1116
|
+
complete: () => {
|
|
1117
|
+
buffer && subscriber.next(buffer);
|
|
1118
|
+
subscriber.complete();
|
|
1119
|
+
}
|
|
1120
|
+
}, () => buffer = closingSubscriber = null));
|
|
1121
|
+
})(fa);
|
|
1122
|
+
};
|
|
1258
1123
|
}
|
|
1259
1124
|
/**
|
|
1260
|
-
* @tsplus
|
|
1125
|
+
* @tsplus pipeable fncts.observable.Observable catchAllCause
|
|
1261
1126
|
*/
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
syncUnsub = true;
|
|
1127
|
+
function catchAllCause_1(f) {
|
|
1128
|
+
return self => {
|
|
1129
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1130
|
+
let innerSub = null;
|
|
1131
|
+
let syncUnsub = false;
|
|
1132
|
+
let handledResult;
|
|
1133
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1134
|
+
error: cause => {
|
|
1135
|
+
handledResult = from_1(f(cause, catchAllCause_1(f)(source)));
|
|
1136
|
+
if (innerSub) {
|
|
1137
|
+
innerSub.unsubscribe();
|
|
1138
|
+
innerSub = null;
|
|
1139
|
+
handledResult.provideEnvironment(environment).subscribe(subscriber);
|
|
1140
|
+
} else {
|
|
1141
|
+
syncUnsub = true;
|
|
1142
|
+
}
|
|
1279
1143
|
}
|
|
1144
|
+
}));
|
|
1145
|
+
if (syncUnsub) {
|
|
1146
|
+
innerSub.unsubscribe();
|
|
1147
|
+
innerSub = null;
|
|
1148
|
+
handledResult.provideEnvironment(environment).subscribe(subscriber);
|
|
1280
1149
|
}
|
|
1281
|
-
}));
|
|
1282
|
-
|
|
1283
|
-
if (syncUnsub) {
|
|
1284
|
-
innerSub.unsubscribe();
|
|
1285
|
-
innerSub = null;
|
|
1286
|
-
handledResult.subscribe(subscriber);
|
|
1287
|
-
}
|
|
1288
|
-
});
|
|
1150
|
+
})(self);
|
|
1151
|
+
};
|
|
1289
1152
|
}
|
|
1290
1153
|
/**
|
|
1291
1154
|
* @tsplus getter fncts.observable.Observable concatAll
|
|
1292
1155
|
*/
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
1156
|
function concatAll_1(ffa) {
|
|
1296
|
-
return mergeAll_1(
|
|
1157
|
+
return mergeAll_1(1)(ffa);
|
|
1297
1158
|
}
|
|
1298
1159
|
/**
|
|
1299
|
-
* @tsplus
|
|
1160
|
+
* @tsplus pipeable fncts.observable.Observable concat
|
|
1300
1161
|
*/
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1162
|
+
function concat_1(...sources) {
|
|
1163
|
+
return fa => {
|
|
1164
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1165
|
+
concatAll_1(fromArrayLike([source, ...sources])).provideEnvironment(environment).subscribe(subscriber);
|
|
1166
|
+
})(fa);
|
|
1167
|
+
};
|
|
1307
1168
|
}
|
|
1308
1169
|
/**
|
|
1309
1170
|
* @tsplus getter fncts.observable.Observable count
|
|
1310
1171
|
*/
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
1172
|
function count(fa) {
|
|
1314
|
-
return foldLeft_1(
|
|
1173
|
+
return foldLeft_1(0, (total, _) => total + 1)(fa);
|
|
1315
1174
|
}
|
|
1316
1175
|
/**
|
|
1317
|
-
* @tsplus
|
|
1176
|
+
* @tsplus pipeable fncts.observable.Observable countWithIndex
|
|
1318
1177
|
*/
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1178
|
+
function countWithIndex_1(predicate) {
|
|
1179
|
+
return fa => {
|
|
1180
|
+
return foldLeftWithIndex_1(0, (i, total, v) => predicate(i, v) ? total + 1 : total)(fa);
|
|
1181
|
+
};
|
|
1323
1182
|
}
|
|
1324
1183
|
/**
|
|
1325
|
-
* @tsplus
|
|
1184
|
+
* @tsplus pipeable fncts.observable.Observable countWith
|
|
1326
1185
|
*/
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1186
|
+
function countWith(predicate) {
|
|
1187
|
+
return fa => {
|
|
1188
|
+
return countWithIndex_1((_, a) => predicate(a))(fa);
|
|
1189
|
+
};
|
|
1331
1190
|
}
|
|
1332
1191
|
/**
|
|
1333
1192
|
* @tsplus getter fncts.observable.Observable combineLatestAll
|
|
1334
1193
|
*/
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
1194
|
function combineLatestAll(fa) {
|
|
1338
|
-
return joinAllInternal(fa, sources => !sources.length ? empty_1() :
|
|
1195
|
+
return joinAllInternal(fa, sources => !sources.length ? empty_1() : zipLatest_1(sources[0], ...sources.slice(1)));
|
|
1339
1196
|
}
|
|
1340
1197
|
/**
|
|
1341
|
-
* @tsplus
|
|
1198
|
+
* @tsplus pipeable fncts.observable.Observable zipLatest
|
|
1342
1199
|
*/
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
});
|
|
1200
|
+
function zipLatest_1(...sources) {
|
|
1201
|
+
return self => {
|
|
1202
|
+
if (!sources.length) {
|
|
1203
|
+
return from_1(self).unsafeCoerce();
|
|
1204
|
+
}
|
|
1205
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1206
|
+
combineLatestInternal(subscriber, environment, [source, ...sources]);
|
|
1207
|
+
})(from_1(self));
|
|
1208
|
+
};
|
|
1353
1209
|
}
|
|
1354
1210
|
/**
|
|
1355
|
-
* @tsplus
|
|
1211
|
+
* @tsplus pipeable fncts.observable.Observable zipWithLatest
|
|
1356
1212
|
*/
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
let lastValue = tsplus_module_17.nothing();
|
|
1362
|
-
let durationSubscriber = null;
|
|
1363
|
-
|
|
1364
|
-
const emit = () => {
|
|
1365
|
-
durationSubscriber?.unsubscribe();
|
|
1366
|
-
durationSubscriber = null;
|
|
1367
|
-
|
|
1368
|
-
if (tsplus_module_18.isJust(lastValue)) {
|
|
1369
|
-
const {
|
|
1370
|
-
value
|
|
1371
|
-
} = lastValue;
|
|
1372
|
-
lastValue = tsplus_module_17.nothing();
|
|
1373
|
-
subscriber.next(value);
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1378
|
-
next: value => {
|
|
1379
|
-
durationSubscriber?.unsubscribe();
|
|
1380
|
-
lastValue = tsplus_module_17.just(value);
|
|
1381
|
-
durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1382
|
-
next: emit,
|
|
1383
|
-
complete: tsplus_module_2.noop
|
|
1384
|
-
});
|
|
1385
|
-
from_1(durationSelector(value)).subscribe(durationSubscriber);
|
|
1386
|
-
},
|
|
1387
|
-
complete: () => {
|
|
1388
|
-
emit();
|
|
1389
|
-
subscriber.complete();
|
|
1390
|
-
}
|
|
1391
|
-
}, () => {
|
|
1392
|
-
lastValue = durationSubscriber = null;
|
|
1393
|
-
}));
|
|
1394
|
-
});
|
|
1213
|
+
function zipWithLatest(that, f) {
|
|
1214
|
+
return self => {
|
|
1215
|
+
return map_1(tsplus_module_13.tupled(f))(zipLatest_1(from_1(that))(self));
|
|
1216
|
+
};
|
|
1395
1217
|
}
|
|
1396
1218
|
/**
|
|
1397
|
-
* @tsplus
|
|
1219
|
+
* @tsplus pipeable fncts.observable.Observable debounceWith
|
|
1398
1220
|
*/
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1221
|
+
function debounceWith(durationSelector) {
|
|
1222
|
+
return fa => {
|
|
1223
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1224
|
+
let lastValue = tsplus_module_17.nothing();
|
|
1225
|
+
let durationSubscriber = null;
|
|
1226
|
+
const emit = () => {
|
|
1227
|
+
durationSubscriber?.unsubscribe();
|
|
1228
|
+
durationSubscriber = null;
|
|
1229
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
1230
|
+
const {
|
|
1231
|
+
value
|
|
1232
|
+
} = lastValue;
|
|
1233
|
+
lastValue = tsplus_module_17.nothing();
|
|
1234
|
+
subscriber.next(value);
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1238
|
+
next: value => {
|
|
1239
|
+
durationSubscriber?.unsubscribe();
|
|
1240
|
+
lastValue = tsplus_module_17.just(value);
|
|
1241
|
+
durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1242
|
+
next: emit,
|
|
1243
|
+
complete: tsplus_module_2.noop
|
|
1244
|
+
});
|
|
1245
|
+
from_1(durationSelector(value)).provideEnvironment(environment).subscribe(durationSubscriber);
|
|
1246
|
+
},
|
|
1247
|
+
complete: () => {
|
|
1248
|
+
emit();
|
|
1249
|
+
subscriber.complete();
|
|
1250
|
+
}
|
|
1251
|
+
}, () => {
|
|
1252
|
+
lastValue = durationSubscriber = null;
|
|
1253
|
+
}));
|
|
1254
|
+
})(fa);
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* @tsplus pipeable fncts.observable.Observable debounce
|
|
1259
|
+
*/
|
|
1260
|
+
function debounce(dueTime, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1261
|
+
return fa => {
|
|
1262
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1263
|
+
let activeTask = null;
|
|
1264
|
+
let lastValue = null;
|
|
1265
|
+
let lastTime = null;
|
|
1266
|
+
const emit = () => {
|
|
1267
|
+
if (activeTask) {
|
|
1268
|
+
activeTask.unsubscribe();
|
|
1269
|
+
activeTask = null;
|
|
1270
|
+
const value = lastValue;
|
|
1271
|
+
lastValue = null;
|
|
1272
|
+
subscriber.next(value);
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
function emitWhenIdle() {
|
|
1276
|
+
const targetTime = lastTime + dueTime;
|
|
1277
|
+
const now = scheduler.now();
|
|
1278
|
+
if (now < targetTime) {
|
|
1279
|
+
activeTask = this.schedule(undefined, targetTime - now);
|
|
1437
1280
|
subscriber.add(activeTask);
|
|
1281
|
+
return;
|
|
1438
1282
|
}
|
|
1439
|
-
},
|
|
1440
|
-
complete: () => {
|
|
1441
1283
|
emit();
|
|
1442
|
-
subscriber.complete();
|
|
1443
1284
|
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1285
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1286
|
+
next: value => {
|
|
1287
|
+
lastValue = value;
|
|
1288
|
+
lastTime = scheduler.now();
|
|
1289
|
+
if (!activeTask) {
|
|
1290
|
+
activeTask = scheduler.schedule(emitWhenIdle, dueTime);
|
|
1291
|
+
subscriber.add(activeTask);
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
complete: () => {
|
|
1295
|
+
emit();
|
|
1296
|
+
subscriber.complete();
|
|
1297
|
+
}
|
|
1298
|
+
}, () => {
|
|
1299
|
+
lastValue = activeTask = null;
|
|
1300
|
+
}));
|
|
1301
|
+
})(fa);
|
|
1302
|
+
};
|
|
1448
1303
|
}
|
|
1449
1304
|
/**
|
|
1450
1305
|
* @tsplus getter fncts.observable.Observable either
|
|
1451
1306
|
*/
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
1307
|
function either(fa) {
|
|
1455
|
-
return tsplus_module_8.operate_(
|
|
1456
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1308
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1309
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1457
1310
|
next: value => {
|
|
1458
1311
|
subscriber.next(tsplus_module_19.right(value));
|
|
1459
1312
|
},
|
|
1460
1313
|
error: error => {
|
|
1461
|
-
tsplus_module_14.
|
|
1314
|
+
tsplus_module_14.match(e => subscriber.next(tsplus_module_19.left(e)), cause => subscriber.error(cause))(tsplus_module_1.failureOrCause(error));
|
|
1462
1315
|
}
|
|
1463
1316
|
}));
|
|
1464
|
-
});
|
|
1317
|
+
})(fa);
|
|
1465
1318
|
}
|
|
1466
1319
|
/**
|
|
1467
|
-
* @tsplus
|
|
1320
|
+
* @tsplus pipeable fncts.observable.Observable delayWithIndex
|
|
1468
1321
|
*/
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1322
|
+
function delayWithIndex_1(f) {
|
|
1323
|
+
return fa => {
|
|
1324
|
+
return mergeMapWithIndex_1((i, a) => as_1(() => a)(take_1(1)(f(i, a))))(fa);
|
|
1325
|
+
};
|
|
1473
1326
|
}
|
|
1474
1327
|
/**
|
|
1475
|
-
* @tsplus
|
|
1328
|
+
* @tsplus pipeable fncts.observable.Observable delayWith
|
|
1476
1329
|
*/
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1330
|
+
function delayWith_1(f) {
|
|
1331
|
+
return fa => {
|
|
1332
|
+
return delayWithIndex_1((_, a) => f(a))(fa);
|
|
1333
|
+
};
|
|
1481
1334
|
}
|
|
1482
1335
|
/**
|
|
1483
|
-
* @tsplus
|
|
1336
|
+
* @tsplus pipeable fncts.observable.Observable delay
|
|
1484
1337
|
*/
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1338
|
+
function delay(due, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1339
|
+
return fa => {
|
|
1340
|
+
const duration = timer_1(due, scheduler);
|
|
1341
|
+
return delayWith_1(() => duration)(fa);
|
|
1342
|
+
};
|
|
1490
1343
|
}
|
|
1491
1344
|
/**
|
|
1492
1345
|
* @tsplus getter fncts.observable.Observable dematerialize
|
|
1493
1346
|
*/
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
1347
|
function dematerialize(fa) {
|
|
1497
|
-
return tsplus_module_8.operate_(
|
|
1498
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1499
|
-
next: notification => tsplus_module_20.
|
|
1348
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1349
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1350
|
+
next: notification => tsplus_module_20.observe(subscriber)(notification)
|
|
1500
1351
|
}));
|
|
1501
|
-
});
|
|
1352
|
+
})(fa);
|
|
1502
1353
|
}
|
|
1503
1354
|
/**
|
|
1504
|
-
* @tsplus
|
|
1355
|
+
* @tsplus pipeable fncts.observable.Observable ensuring
|
|
1505
1356
|
*/
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1357
|
+
function ensuring(finalizer) {
|
|
1358
|
+
return fa => {
|
|
1359
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1360
|
+
source.provideEnvironment(environment).subscribe(subscriber);
|
|
1361
|
+
subscriber.add(finalizer);
|
|
1362
|
+
})(fa);
|
|
1363
|
+
};
|
|
1513
1364
|
}
|
|
1514
1365
|
/**
|
|
1515
1366
|
* @tsplus getter fncts.observable.Observable exhaustAll
|
|
1516
1367
|
*/
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
1368
|
function exhaustAll(ffa) {
|
|
1520
|
-
return tsplus_module_8.operate_(
|
|
1369
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1521
1370
|
let isComplete = false;
|
|
1522
1371
|
let innerSub = null;
|
|
1523
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1372
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1524
1373
|
next: inner => {
|
|
1525
1374
|
if (!innerSub) {
|
|
1526
|
-
innerSub = from_1(inner).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1375
|
+
innerSub = from_1(inner).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1527
1376
|
complete: () => {
|
|
1528
1377
|
innerSub = null;
|
|
1529
1378
|
isComplete && subscriber.complete();
|
|
@@ -1536,80 +1385,82 @@ function exhaustAll(ffa) {
|
|
|
1536
1385
|
!innerSub && subscriber.complete();
|
|
1537
1386
|
}
|
|
1538
1387
|
}));
|
|
1539
|
-
});
|
|
1540
|
-
}
|
|
1541
|
-
/**
|
|
1542
|
-
* @tsplus
|
|
1543
|
-
*/
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1388
|
+
})(ffa);
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* @tsplus pipeable fncts.observable.Observable exhaustMapWithIndex
|
|
1392
|
+
*/
|
|
1393
|
+
function exhaustMapWithIndex_1(f) {
|
|
1394
|
+
return self => {
|
|
1395
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1396
|
+
let index = 0;
|
|
1397
|
+
let innerSub = null;
|
|
1398
|
+
let isComplete = false;
|
|
1399
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1400
|
+
next: outerValue => {
|
|
1401
|
+
if (!innerSub) {
|
|
1402
|
+
innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1403
|
+
complete: () => {
|
|
1404
|
+
innerSub = null;
|
|
1405
|
+
isComplete && subscriber.complete();
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
from_1(f(index++, outerValue)).provideEnvironment(environment).subscribe(innerSub);
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
complete: () => {
|
|
1412
|
+
isComplete = true;
|
|
1413
|
+
!innerSub && subscriber.complete();
|
|
1561
1414
|
}
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
!innerSub && subscriber.complete();
|
|
1566
|
-
}
|
|
1567
|
-
}));
|
|
1568
|
-
});
|
|
1415
|
+
}));
|
|
1416
|
+
})(self);
|
|
1417
|
+
};
|
|
1569
1418
|
}
|
|
1570
1419
|
/**
|
|
1571
|
-
* @tsplus
|
|
1420
|
+
* @tsplus pipeable fncts.observable.Observable exhaustMap
|
|
1572
1421
|
*/
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1422
|
+
function exhaustMap(f) {
|
|
1423
|
+
return self => {
|
|
1424
|
+
return exhaustMapWithIndex_1((_, a) => f(a))(self);
|
|
1425
|
+
};
|
|
1577
1426
|
}
|
|
1578
1427
|
/**
|
|
1579
|
-
* @tsplus
|
|
1428
|
+
* @tsplus pipeable fncts.observable.Observable expandWithIndex
|
|
1580
1429
|
*/
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
return tsplus_module_8.operate_(fa, (source, subscriber) => mergeInternal(source, subscriber, f, concurrent, undefined, true));
|
|
1430
|
+
function expandWithIndex_1(f, concurrent = Infinity) {
|
|
1431
|
+
return fa => {
|
|
1432
|
+
concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
|
|
1433
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => mergeInternal(source, subscriber, environment, f, concurrent, undefined, true))(fa);
|
|
1434
|
+
};
|
|
1587
1435
|
}
|
|
1588
1436
|
/**
|
|
1589
|
-
* @tsplus
|
|
1437
|
+
* @tsplus pipeable fncts.observable.Observable expand
|
|
1590
1438
|
*/
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1439
|
+
function expand(f, concurrent = Infinity) {
|
|
1440
|
+
return fa => {
|
|
1441
|
+
return expandWithIndex_1((_, a) => f(a), concurrent)(fa);
|
|
1442
|
+
};
|
|
1595
1443
|
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1444
|
+
function findWithIndex_1(predicate) {
|
|
1445
|
+
return fa => {
|
|
1446
|
+
return tsplus_module_8.operate_(findInternal(predicate, "value"))(fa);
|
|
1447
|
+
};
|
|
1599
1448
|
}
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1449
|
+
function find(predicate) {
|
|
1450
|
+
return fa => {
|
|
1451
|
+
return findWithIndex_1((_, a) => predicate(a))(fa);
|
|
1452
|
+
};
|
|
1603
1453
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1454
|
+
function findIndexWithIndex_1(predicate) {
|
|
1455
|
+
return fa => {
|
|
1456
|
+
return tsplus_module_8.operate_(findInternal(predicate, "index"))(fa);
|
|
1457
|
+
};
|
|
1607
1458
|
}
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1459
|
+
function findIndex(predicate) {
|
|
1460
|
+
return fa => {
|
|
1461
|
+
return findIndexWithIndex_1((_, a) => predicate(a))(fa);
|
|
1462
|
+
};
|
|
1611
1463
|
}
|
|
1612
|
-
|
|
1613
1464
|
function forkJoin(...args) {
|
|
1614
1465
|
const {
|
|
1615
1466
|
args: sources,
|
|
@@ -1617,16 +1468,13 @@ function forkJoin(...args) {
|
|
|
1617
1468
|
} = (0, tsplus_module_2.arrayOrObject)(args);
|
|
1618
1469
|
return new _definition2.Observable(s => {
|
|
1619
1470
|
const length = sources.length;
|
|
1620
|
-
|
|
1621
1471
|
if (!length) {
|
|
1622
1472
|
s.complete();
|
|
1623
1473
|
return;
|
|
1624
1474
|
}
|
|
1625
|
-
|
|
1626
1475
|
const values = new Array(length);
|
|
1627
1476
|
let remainingCompletions = length;
|
|
1628
1477
|
let remainingEmissions = length;
|
|
1629
|
-
|
|
1630
1478
|
for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
|
|
1631
1479
|
let hasValue = false;
|
|
1632
1480
|
from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(s, {
|
|
@@ -1635,7 +1483,6 @@ function forkJoin(...args) {
|
|
|
1635
1483
|
hasValue = true;
|
|
1636
1484
|
remainingEmissions--;
|
|
1637
1485
|
}
|
|
1638
|
-
|
|
1639
1486
|
values[sourceIndex] = value;
|
|
1640
1487
|
},
|
|
1641
1488
|
complete: () => {
|
|
@@ -1646,7 +1493,6 @@ function forkJoin(...args) {
|
|
|
1646
1493
|
return b;
|
|
1647
1494
|
}, {}) : values);
|
|
1648
1495
|
}
|
|
1649
|
-
|
|
1650
1496
|
s.complete();
|
|
1651
1497
|
}
|
|
1652
1498
|
}
|
|
@@ -1657,23 +1503,19 @@ function forkJoin(...args) {
|
|
|
1657
1503
|
/**
|
|
1658
1504
|
* @tsplus getter fncts.observable.Observable ignore
|
|
1659
1505
|
*/
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
1506
|
function ignore(fa) {
|
|
1663
|
-
return tsplus_module_8.operate_(
|
|
1664
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1507
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1508
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1665
1509
|
next: tsplus_module_2.noop
|
|
1666
1510
|
}));
|
|
1667
|
-
});
|
|
1511
|
+
})(fa);
|
|
1668
1512
|
}
|
|
1669
1513
|
/**
|
|
1670
1514
|
* @tsplus getter fncts.observable.Observable isEmpty
|
|
1671
1515
|
*/
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
1516
|
function isEmpty(fa) {
|
|
1675
|
-
return tsplus_module_8.operate_(
|
|
1676
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1517
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1518
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1677
1519
|
next: () => {
|
|
1678
1520
|
subscriber.next(false);
|
|
1679
1521
|
subscriber.complete();
|
|
@@ -1683,16 +1525,14 @@ function isEmpty(fa) {
|
|
|
1683
1525
|
subscriber.complete();
|
|
1684
1526
|
}
|
|
1685
1527
|
}));
|
|
1686
|
-
});
|
|
1528
|
+
})(fa);
|
|
1687
1529
|
}
|
|
1688
1530
|
/**
|
|
1689
1531
|
* @tsplus getter fncts.observable.Observable materialize
|
|
1690
1532
|
*/
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
1533
|
function materialize(fa) {
|
|
1694
|
-
return tsplus_module_8.operate_(
|
|
1695
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1534
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1535
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1696
1536
|
next: value => {
|
|
1697
1537
|
subscriber.next(tsplus_module_20.next(value));
|
|
1698
1538
|
},
|
|
@@ -1703,727 +1543,678 @@ function materialize(fa) {
|
|
|
1703
1543
|
subscriber.next(tsplus_module_20.complete());
|
|
1704
1544
|
}
|
|
1705
1545
|
}));
|
|
1706
|
-
});
|
|
1546
|
+
})(fa);
|
|
1707
1547
|
}
|
|
1708
1548
|
/**
|
|
1709
|
-
* @tsplus
|
|
1549
|
+
* @tsplus pipeable fncts.observable.Observable mergeAll
|
|
1710
1550
|
*/
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1551
|
+
function mergeAll_1(concurrent = Infinity) {
|
|
1552
|
+
return self => {
|
|
1553
|
+
return mergeMap_1(tsplus_module_13.identity, concurrent)(self);
|
|
1554
|
+
};
|
|
1715
1555
|
}
|
|
1716
1556
|
/**
|
|
1717
|
-
* @tsplus
|
|
1557
|
+
* @tsplus pipeable fncts.observable.Observable mergeScanWithIndex
|
|
1718
1558
|
*/
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
state =
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1559
|
+
function mergeScanWithIndex_1(initial, f, concurrent = Infinity) {
|
|
1560
|
+
return fa => {
|
|
1561
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1562
|
+
let state = initial;
|
|
1563
|
+
return mergeInternal(source, subscriber, environment, (index, value) => f(index, state, value), concurrent, value => {
|
|
1564
|
+
state = value;
|
|
1565
|
+
}, false, undefined, () => state = null);
|
|
1566
|
+
})(fa);
|
|
1567
|
+
};
|
|
1728
1568
|
}
|
|
1729
1569
|
/**
|
|
1730
|
-
* @tsplus
|
|
1570
|
+
* @tsplus pipeable fncts.observable.Observable mergeScan
|
|
1731
1571
|
*/
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1572
|
+
function mergeScan(initial, f, concurrent = Infinity) {
|
|
1573
|
+
return fa => {
|
|
1574
|
+
return mergeScanWithIndex_1(initial, (_, b, a) => f(b, a), concurrent)(fa);
|
|
1575
|
+
};
|
|
1736
1576
|
}
|
|
1737
|
-
|
|
1738
1577
|
function onErrorResumeNext(fa, ...sources) {
|
|
1739
|
-
return tsplus_module_8.operate_(
|
|
1578
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1740
1579
|
const remaining = [source, ...sources];
|
|
1741
|
-
|
|
1742
1580
|
const subscribeNext = () => {
|
|
1743
1581
|
if (!subscriber.closed) {
|
|
1744
1582
|
if (remaining.length > 0) {
|
|
1745
1583
|
let nextSource;
|
|
1746
|
-
|
|
1747
1584
|
try {
|
|
1748
1585
|
nextSource = from_1(remaining.shift());
|
|
1749
1586
|
} catch (err) {
|
|
1750
1587
|
subscribeNext();
|
|
1751
1588
|
return;
|
|
1752
1589
|
}
|
|
1753
|
-
|
|
1754
1590
|
const innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1755
1591
|
error: tsplus_module_2.noop,
|
|
1756
1592
|
complete: tsplus_module_2.noop
|
|
1757
1593
|
});
|
|
1758
|
-
subscriber.add(nextSource.subscribe(innerSub));
|
|
1594
|
+
subscriber.add(nextSource.provideEnvironment(environment).subscribe(innerSub));
|
|
1759
1595
|
innerSub.add(subscribeNext);
|
|
1760
1596
|
} else {
|
|
1761
1597
|
subscriber.complete();
|
|
1762
1598
|
}
|
|
1763
1599
|
}
|
|
1764
1600
|
};
|
|
1765
|
-
|
|
1766
1601
|
subscribeNext();
|
|
1767
|
-
});
|
|
1602
|
+
})(fa);
|
|
1768
1603
|
}
|
|
1769
1604
|
/**
|
|
1770
|
-
* @tsplus
|
|
1605
|
+
* @tsplus pipeable fncts.observable.Observable onEmpty
|
|
1771
1606
|
*/
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1607
|
+
function onEmpty_1(f) {
|
|
1608
|
+
return fa => {
|
|
1609
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1610
|
+
let hasValue = false;
|
|
1611
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1612
|
+
next: value => {
|
|
1613
|
+
hasValue = true;
|
|
1614
|
+
subscriber.next(value);
|
|
1615
|
+
},
|
|
1616
|
+
complete: () => {
|
|
1617
|
+
if (!hasValue) {
|
|
1618
|
+
subscriber.next(f());
|
|
1619
|
+
}
|
|
1620
|
+
subscriber.complete();
|
|
1785
1621
|
}
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
}));
|
|
1790
|
-
});
|
|
1622
|
+
}));
|
|
1623
|
+
})(fa);
|
|
1624
|
+
};
|
|
1791
1625
|
}
|
|
1792
1626
|
/**
|
|
1793
|
-
* @tsplus
|
|
1627
|
+
* @tsplus pipeable fncts.observable.Observable repeat
|
|
1794
1628
|
*/
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1629
|
+
function repeat(count = Infinity) {
|
|
1630
|
+
return fa => {
|
|
1631
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1632
|
+
let repeats = 0;
|
|
1633
|
+
let innerSub;
|
|
1634
|
+
const loop = () => {
|
|
1635
|
+
let syncUnsub = false;
|
|
1636
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1637
|
+
complete: () => {
|
|
1638
|
+
if (++repeats < count) {
|
|
1639
|
+
if (innerSub) {
|
|
1640
|
+
innerSub.unsubscribe();
|
|
1641
|
+
innerSub = null;
|
|
1642
|
+
loop();
|
|
1643
|
+
} else {
|
|
1644
|
+
syncUnsub = true;
|
|
1645
|
+
}
|
|
1811
1646
|
} else {
|
|
1812
|
-
|
|
1647
|
+
subscriber.complete;
|
|
1813
1648
|
}
|
|
1814
|
-
} else {
|
|
1815
|
-
subscriber.complete;
|
|
1816
1649
|
}
|
|
1650
|
+
}));
|
|
1651
|
+
if (syncUnsub) {
|
|
1652
|
+
innerSub.unsubscribe();
|
|
1653
|
+
innerSub = null;
|
|
1654
|
+
loop();
|
|
1817
1655
|
}
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
innerSub = null;
|
|
1823
|
-
loop();
|
|
1824
|
-
}
|
|
1825
|
-
};
|
|
1826
|
-
|
|
1827
|
-
loop();
|
|
1828
|
-
});
|
|
1656
|
+
};
|
|
1657
|
+
loop();
|
|
1658
|
+
})(fa);
|
|
1659
|
+
};
|
|
1829
1660
|
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
loop();
|
|
1661
|
+
function retry(configOrCount = Infinity) {
|
|
1662
|
+
return fa => {
|
|
1663
|
+
let config;
|
|
1664
|
+
if (configOrCount && typeof configOrCount === "object") {
|
|
1665
|
+
config = configOrCount;
|
|
1666
|
+
} else {
|
|
1667
|
+
config = {
|
|
1668
|
+
count: configOrCount
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
const {
|
|
1672
|
+
count,
|
|
1673
|
+
resetOnSuccess = false
|
|
1674
|
+
} = config;
|
|
1675
|
+
return count <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1676
|
+
let retries = 0;
|
|
1677
|
+
let innerSub;
|
|
1678
|
+
const loop = () => {
|
|
1679
|
+
let syncUnsub = false;
|
|
1680
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1681
|
+
next: value => {
|
|
1682
|
+
if (resetOnSuccess) {
|
|
1683
|
+
retries = 0;
|
|
1684
|
+
}
|
|
1685
|
+
subscriber.next(value);
|
|
1686
|
+
},
|
|
1687
|
+
error: err => {
|
|
1688
|
+
if (retries++ < count) {
|
|
1689
|
+
if (innerSub) {
|
|
1690
|
+
innerSub.unsubscribe();
|
|
1691
|
+
innerSub = null;
|
|
1692
|
+
loop();
|
|
1693
|
+
} else {
|
|
1694
|
+
syncUnsub = true;
|
|
1695
|
+
}
|
|
1866
1696
|
} else {
|
|
1867
|
-
|
|
1697
|
+
subscriber.error(err);
|
|
1868
1698
|
}
|
|
1869
|
-
} else {
|
|
1870
|
-
subscriber.error(err);
|
|
1871
1699
|
}
|
|
1700
|
+
}));
|
|
1701
|
+
if (syncUnsub) {
|
|
1702
|
+
innerSub.unsubscribe();
|
|
1703
|
+
innerSub = null;
|
|
1704
|
+
loop();
|
|
1872
1705
|
}
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
innerSub = null;
|
|
1878
|
-
loop();
|
|
1879
|
-
}
|
|
1880
|
-
};
|
|
1881
|
-
|
|
1882
|
-
loop();
|
|
1883
|
-
});
|
|
1706
|
+
};
|
|
1707
|
+
loop();
|
|
1708
|
+
})(fa);
|
|
1709
|
+
};
|
|
1884
1710
|
}
|
|
1885
1711
|
/**
|
|
1886
|
-
* @tsplus
|
|
1712
|
+
* @tsplus pipeable fncts.observable.Observable sample
|
|
1887
1713
|
*/
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
}));
|
|
1914
|
-
});
|
|
1714
|
+
function sample_1(notifier) {
|
|
1715
|
+
return fa => {
|
|
1716
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1717
|
+
let hasValue = false;
|
|
1718
|
+
let lastValue = null;
|
|
1719
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1720
|
+
next: value => {
|
|
1721
|
+
hasValue = true;
|
|
1722
|
+
lastValue = value;
|
|
1723
|
+
}
|
|
1724
|
+
}));
|
|
1725
|
+
const emit = () => {
|
|
1726
|
+
if (hasValue) {
|
|
1727
|
+
hasValue = false;
|
|
1728
|
+
const value = lastValue;
|
|
1729
|
+
lastValue = null;
|
|
1730
|
+
subscriber.next(value);
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
notifier.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1734
|
+
next: emit,
|
|
1735
|
+
complete: tsplus_module_2.noop
|
|
1736
|
+
}));
|
|
1737
|
+
})(fa);
|
|
1738
|
+
};
|
|
1915
1739
|
}
|
|
1916
1740
|
/**
|
|
1917
|
-
* @tsplus
|
|
1741
|
+
* @tsplus pipeable fncts.observable.Observable sampleTime
|
|
1918
1742
|
*/
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1743
|
+
function sampleTime(period, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1744
|
+
return fa => {
|
|
1745
|
+
return sample_1(interval_1(period, scheduler))(fa);
|
|
1746
|
+
};
|
|
1923
1747
|
}
|
|
1924
1748
|
/**
|
|
1925
|
-
* @tsplus
|
|
1749
|
+
* @tsplus pipeable fncts.observable.Observable scanLeftWithIndex
|
|
1926
1750
|
*/
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1751
|
+
function scanLeftWithIndex_1(initial, f) {
|
|
1752
|
+
return fa => {
|
|
1753
|
+
return tsplus_module_8.operate_(scanInternal(f, initial, true, true))(fa);
|
|
1754
|
+
};
|
|
1931
1755
|
}
|
|
1932
1756
|
/**
|
|
1933
|
-
* @tsplus
|
|
1757
|
+
* @tsplus pipeable fncts.observable.Observable scanLeft
|
|
1934
1758
|
*/
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1759
|
+
function scanLeft(initial, f) {
|
|
1760
|
+
return fa => {
|
|
1761
|
+
return scanLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
1762
|
+
};
|
|
1939
1763
|
}
|
|
1940
1764
|
/**
|
|
1941
1765
|
* @tsplus static fncts.observable.ObservableOps service
|
|
1942
1766
|
*/
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
function service(
|
|
1946
|
-
/** @tsplus auto */
|
|
1947
|
-
tag) {
|
|
1767
|
+
function service( /** @tsplus auto */tag) {
|
|
1948
1768
|
return serviceWithObservable_1(service => of_1(service), tag);
|
|
1949
1769
|
}
|
|
1950
1770
|
/**
|
|
1951
1771
|
* @tsplus static fncts.observable.ObservableOps serviceWith
|
|
1952
1772
|
*/
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
function serviceWith(f,
|
|
1956
|
-
/** @tsplus auto */
|
|
1957
|
-
tag) {
|
|
1773
|
+
function serviceWith(f, /** @tsplus auto */tag) {
|
|
1958
1774
|
return serviceWithObservable_1(service => of_1(f(service)), tag);
|
|
1959
1775
|
}
|
|
1960
1776
|
/**
|
|
1961
1777
|
* @tsplus static fncts.observable.ObservableOps serviceWithObservable
|
|
1962
1778
|
*/
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
function serviceWithObservable_1(f,
|
|
1966
|
-
/** @tsplus auto */
|
|
1967
|
-
tag) {
|
|
1968
|
-
return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(environment, tag)));
|
|
1779
|
+
function serviceWithObservable_1(f, /** @tsplus auto */tag) {
|
|
1780
|
+
return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(tag)(environment)));
|
|
1969
1781
|
}
|
|
1970
1782
|
/**
|
|
1971
|
-
* @tsplus
|
|
1783
|
+
* @tsplus pipeable fncts.observable.Observable skip
|
|
1972
1784
|
*/
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1785
|
+
function skip(count) {
|
|
1786
|
+
return fa => {
|
|
1787
|
+
return filterWithIndex_1((index, _) => count <= index)(fa);
|
|
1788
|
+
};
|
|
1977
1789
|
}
|
|
1978
1790
|
/**
|
|
1979
|
-
* @tsplus
|
|
1791
|
+
* @tsplus pipeable fncts.observable.Observable skipLast
|
|
1980
1792
|
*/
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
subscriber.next(oldValue);
|
|
1793
|
+
function skipLast(skipCount) {
|
|
1794
|
+
return fa => {
|
|
1795
|
+
return skipCount <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1796
|
+
let ring = new Array(skipCount);
|
|
1797
|
+
let seen = 0;
|
|
1798
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1799
|
+
next: value => {
|
|
1800
|
+
const valueIndex = seen++;
|
|
1801
|
+
if (valueIndex < skipCount) {
|
|
1802
|
+
ring[valueIndex] = value;
|
|
1803
|
+
} else {
|
|
1804
|
+
const index = valueIndex % skipCount;
|
|
1805
|
+
const oldValue = ring[index];
|
|
1806
|
+
ring[index] = value;
|
|
1807
|
+
subscriber.next(oldValue);
|
|
1808
|
+
}
|
|
1998
1809
|
}
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
};
|
|
2004
|
-
}
|
|
1810
|
+
}));
|
|
1811
|
+
return () => {
|
|
1812
|
+
ring = null;
|
|
1813
|
+
};
|
|
1814
|
+
})(fa);
|
|
1815
|
+
};
|
|
2005
1816
|
}
|
|
2006
1817
|
/**
|
|
2007
|
-
* @tsplus
|
|
1818
|
+
* @tsplus pipeable fncts.observable.Observable skipUntil
|
|
2008
1819
|
*/
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
}));
|
|
2025
|
-
}
|
|
1820
|
+
function skipUntil(notifier) {
|
|
1821
|
+
return fa => {
|
|
1822
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1823
|
+
let taking = false;
|
|
1824
|
+
const skipSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1825
|
+
next: () => {
|
|
1826
|
+
skipSubscriber?.unsubscribe();
|
|
1827
|
+
taking = true;
|
|
1828
|
+
},
|
|
1829
|
+
complete: tsplus_module_2.noop
|
|
1830
|
+
});
|
|
1831
|
+
from_1(notifier).provideEnvironment(environment).subscribe(skipSubscriber);
|
|
1832
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1833
|
+
next: value => taking && subscriber.next(value)
|
|
1834
|
+
}));
|
|
1835
|
+
})(fa);
|
|
1836
|
+
};
|
|
2026
1837
|
}
|
|
2027
1838
|
/**
|
|
2028
|
-
* @tsplus
|
|
1839
|
+
* @tsplus pipeable fncts.observable.Observable skipWhile
|
|
2029
1840
|
*/
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
}));
|
|
2039
|
-
}
|
|
1841
|
+
function skipWhile(predicate) {
|
|
1842
|
+
return fa => {
|
|
1843
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1844
|
+
let taking = false;
|
|
1845
|
+
let index = 0;
|
|
1846
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1847
|
+
next: value => (taking || (taking = !predicate(index++, value))) && subscriber.next(value)
|
|
1848
|
+
}));
|
|
1849
|
+
})(fa);
|
|
1850
|
+
};
|
|
2040
1851
|
}
|
|
2041
1852
|
/**
|
|
2042
|
-
* @tsplus
|
|
1853
|
+
* @tsplus pipeable fncts.observable.Observable startWith
|
|
2043
1854
|
*/
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
}
|
|
1855
|
+
function startWith(...values) {
|
|
1856
|
+
return fa => {
|
|
1857
|
+
return tsplus_module_8.operate_((source, subscriber) => {
|
|
1858
|
+
// @ts-expect-error
|
|
1859
|
+
concat_1(values)(source).subscribe(subscriber);
|
|
1860
|
+
})(fa);
|
|
1861
|
+
};
|
|
2051
1862
|
}
|
|
2052
1863
|
/**
|
|
2053
|
-
* @tsplus
|
|
1864
|
+
* @tsplus pipeable fncts.observable.Observable subscribeOn
|
|
2054
1865
|
*/
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
}
|
|
1866
|
+
function subscribeOn(scheduler, delay = 0) {
|
|
1867
|
+
return fa => {
|
|
1868
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1869
|
+
subscriber.add(scheduler.schedule(() => source.provideEnvironment(environment).subscribe(subscriber), delay));
|
|
1870
|
+
})(fa);
|
|
1871
|
+
};
|
|
2061
1872
|
}
|
|
2062
1873
|
/**
|
|
2063
1874
|
* @tsplus getter fncts.observable.Observable switchAll
|
|
2064
1875
|
*/
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
1876
|
function switchAll(ffa) {
|
|
2068
|
-
return switchMap_1(
|
|
1877
|
+
return switchMap_1(tsplus_module_13.identity)(ffa);
|
|
2069
1878
|
}
|
|
2070
1879
|
/**
|
|
2071
|
-
* @tsplus
|
|
1880
|
+
* @tsplus pipeable fncts.observable.Observable switchMapWithIndex
|
|
2072
1881
|
*/
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
}));
|
|
2099
|
-
});
|
|
1882
|
+
function switchMapWithIndex_1(f) {
|
|
1883
|
+
return fa => {
|
|
1884
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1885
|
+
let innerSubscriber = null;
|
|
1886
|
+
let index = 0;
|
|
1887
|
+
let isComplete = false;
|
|
1888
|
+
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
|
|
1889
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1890
|
+
next: value => {
|
|
1891
|
+
innerSubscriber?.unsubscribe();
|
|
1892
|
+
const outerIndex = index++;
|
|
1893
|
+
from_1(f(outerIndex, value)).provideEnvironment(environment).subscribe(innerSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1894
|
+
next: innerValue => subscriber.next(innerValue),
|
|
1895
|
+
complete: () => {
|
|
1896
|
+
innerSubscriber = null;
|
|
1897
|
+
checkComplete();
|
|
1898
|
+
}
|
|
1899
|
+
}));
|
|
1900
|
+
}
|
|
1901
|
+
}, () => {
|
|
1902
|
+
isComplete = true;
|
|
1903
|
+
checkComplete();
|
|
1904
|
+
}));
|
|
1905
|
+
})(fa);
|
|
1906
|
+
};
|
|
2100
1907
|
}
|
|
2101
1908
|
/**
|
|
2102
|
-
* @tsplus
|
|
1909
|
+
* @tsplus pipeable fncts.observable.Observable switchMap
|
|
2103
1910
|
*/
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
1911
|
+
function switchMap_1(f) {
|
|
1912
|
+
return fa => {
|
|
1913
|
+
return switchMapWithIndex_1((_, a) => f(a))(fa);
|
|
1914
|
+
};
|
|
2108
1915
|
}
|
|
2109
1916
|
/**
|
|
2110
|
-
* @tsplus
|
|
1917
|
+
* @tsplus pipeable fncts.observable.Observable switchScanWithIndex
|
|
2111
1918
|
*/
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
};
|
|
2121
|
-
}
|
|
1919
|
+
function switchScanWithIndex_1(initial, f) {
|
|
1920
|
+
return fa => {
|
|
1921
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1922
|
+
let state = initial;
|
|
1923
|
+
switchMapWithIndex_1((index, value) => map_1(b => (state = b, b))(from_1(f(index, state, value))))(source).provideEnvironment(environment).subscribe(subscriber);
|
|
1924
|
+
return () => {
|
|
1925
|
+
state = null;
|
|
1926
|
+
};
|
|
1927
|
+
})(fa);
|
|
1928
|
+
};
|
|
2122
1929
|
}
|
|
2123
1930
|
/**
|
|
2124
|
-
* @tsplus
|
|
1931
|
+
* @tsplus pipeable fncts.observable.Observable switchScan
|
|
2125
1932
|
*/
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
1933
|
+
function switchScan(initial, f) {
|
|
1934
|
+
return fa => {
|
|
1935
|
+
return switchScanWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
1936
|
+
};
|
|
2130
1937
|
}
|
|
2131
1938
|
/**
|
|
2132
|
-
* @tsplus
|
|
1939
|
+
* @tsplus pipeable fncts.observable.Observable take
|
|
2133
1940
|
*/
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
sub.complete();
|
|
1941
|
+
function take_1(count) {
|
|
1942
|
+
return fa => {
|
|
1943
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, sub, environment) => {
|
|
1944
|
+
let seen = 0;
|
|
1945
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(sub, {
|
|
1946
|
+
next: value => {
|
|
1947
|
+
if (++seen <= count) {
|
|
1948
|
+
sub.next(value);
|
|
1949
|
+
if (count <= seen) {
|
|
1950
|
+
sub.complete();
|
|
1951
|
+
}
|
|
2146
1952
|
}
|
|
2147
1953
|
}
|
|
2148
|
-
}
|
|
2149
|
-
}));
|
|
2150
|
-
}
|
|
1954
|
+
}));
|
|
1955
|
+
})(fa);
|
|
1956
|
+
};
|
|
2151
1957
|
}
|
|
2152
1958
|
/**
|
|
2153
|
-
* @tsplus
|
|
1959
|
+
* @tsplus pipeable fncts.observable.Observable takeLast
|
|
2154
1960
|
*/
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
1961
|
+
function takeLast(count) {
|
|
1962
|
+
return fa => {
|
|
1963
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1964
|
+
let buffer = [];
|
|
1965
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1966
|
+
next: value => {
|
|
1967
|
+
buffer.push(value);
|
|
1968
|
+
count < buffer.length && buffer.shift();
|
|
1969
|
+
},
|
|
1970
|
+
complete: () => {
|
|
1971
|
+
for (const value of buffer) {
|
|
1972
|
+
subscriber.next(value);
|
|
1973
|
+
}
|
|
1974
|
+
subscriber.complete();
|
|
2168
1975
|
}
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
}));
|
|
2175
|
-
});
|
|
1976
|
+
}, () => {
|
|
1977
|
+
buffer = null;
|
|
1978
|
+
}));
|
|
1979
|
+
})(fa);
|
|
1980
|
+
};
|
|
2176
1981
|
}
|
|
2177
1982
|
/**
|
|
2178
|
-
* @tsplus
|
|
1983
|
+
* @tsplus pipeable fncts.observable.Observable takeUntil
|
|
2179
1984
|
*/
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
}
|
|
1985
|
+
function takeUntil(notifier) {
|
|
1986
|
+
return fa => {
|
|
1987
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1988
|
+
from_1(notifier).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1989
|
+
next: () => subscriber.complete(),
|
|
1990
|
+
complete: tsplus_module_2.noop
|
|
1991
|
+
}));
|
|
1992
|
+
!subscriber.closed && source.provideEnvironment(environment).subscribe(subscriber);
|
|
1993
|
+
})(fa);
|
|
1994
|
+
};
|
|
2190
1995
|
}
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
1996
|
+
function takeWhileWithIndex_1(predicate, inclusive) {
|
|
1997
|
+
return fa => {
|
|
1998
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1999
|
+
let index = 0;
|
|
2000
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2001
|
+
next: value => {
|
|
2002
|
+
const result = predicate(index++, value);
|
|
2003
|
+
(result || inclusive) && subscriber.next(value);
|
|
2004
|
+
!result && subscriber.complete();
|
|
2005
|
+
}
|
|
2006
|
+
}));
|
|
2007
|
+
})(fa);
|
|
2008
|
+
};
|
|
2203
2009
|
}
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2010
|
+
function takeWhile(predicate, inclusive) {
|
|
2011
|
+
return fa => {
|
|
2012
|
+
return takeWhileWithIndex_1((_, a) => predicate(a), inclusive)(fa);
|
|
2013
|
+
};
|
|
2207
2014
|
}
|
|
2208
2015
|
/**
|
|
2209
|
-
* @tsplus
|
|
2016
|
+
* @tsplus pipeable fncts.observable.Observable tap
|
|
2210
2017
|
*/
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
}
|
|
2228
|
-
}));
|
|
2229
|
-
}
|
|
2018
|
+
function tap(observer) {
|
|
2019
|
+
return fa => {
|
|
2020
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2021
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2022
|
+
next: value => {
|
|
2023
|
+
observer.next?.(value);
|
|
2024
|
+
subscriber.next(value);
|
|
2025
|
+
},
|
|
2026
|
+
error: err => {
|
|
2027
|
+
observer.error?.(err);
|
|
2028
|
+
subscriber.error(err);
|
|
2029
|
+
},
|
|
2030
|
+
complete: () => {
|
|
2031
|
+
observer.complete?.();
|
|
2032
|
+
subscriber.complete();
|
|
2033
|
+
}
|
|
2034
|
+
}));
|
|
2035
|
+
})(fa);
|
|
2036
|
+
};
|
|
2230
2037
|
}
|
|
2231
|
-
|
|
2232
2038
|
const defaultThrottleConfig = {
|
|
2233
2039
|
leading: true,
|
|
2234
2040
|
trailing: false
|
|
2235
2041
|
};
|
|
2236
2042
|
/**
|
|
2237
|
-
* @tsplus
|
|
2043
|
+
* @tsplus pipeable fncts.observable.Observable throttle
|
|
2238
2044
|
*/
|
|
2239
|
-
|
|
2240
2045
|
exports.defaultThrottleConfig = defaultThrottleConfig;
|
|
2241
|
-
|
|
2242
|
-
function throttle_1(fa, durationSelector, {
|
|
2046
|
+
function throttle_1(durationSelector, {
|
|
2243
2047
|
leading,
|
|
2244
2048
|
trailing
|
|
2245
2049
|
} = defaultThrottleConfig) {
|
|
2246
|
-
return
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2050
|
+
return fa => {
|
|
2051
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2052
|
+
let sendValue = tsplus_module_17.nothing();
|
|
2053
|
+
let throttled = null;
|
|
2054
|
+
let isComplete = false;
|
|
2055
|
+
const endThrottling = () => {
|
|
2056
|
+
throttled?.unsubscribe();
|
|
2057
|
+
throttled = null;
|
|
2058
|
+
if (trailing) {
|
|
2059
|
+
send();
|
|
2060
|
+
isComplete && subscriber.complete();
|
|
2061
|
+
}
|
|
2062
|
+
};
|
|
2063
|
+
const cleanupThrottling = () => {
|
|
2064
|
+
throttled = null;
|
|
2257
2065
|
isComplete && subscriber.complete();
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
!(throttled && !throttled.closed) && (leading ? send() : startThrottling(value));
|
|
2286
|
-
},
|
|
2287
|
-
complete: () => {
|
|
2288
|
-
isComplete = true;
|
|
2289
|
-
!(trailing && tsplus_module_18.isJust(sendValue) && throttled && !throttled.closed) && subscriber.complete();
|
|
2290
|
-
}
|
|
2291
|
-
}));
|
|
2292
|
-
});
|
|
2066
|
+
};
|
|
2067
|
+
const startThrottling = value => throttled = from_1(durationSelector(value)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2068
|
+
next: endThrottling,
|
|
2069
|
+
complete: cleanupThrottling
|
|
2070
|
+
}));
|
|
2071
|
+
const send = () => {
|
|
2072
|
+
if (tsplus_module_18.isJust(sendValue)) {
|
|
2073
|
+
const {
|
|
2074
|
+
value
|
|
2075
|
+
} = sendValue;
|
|
2076
|
+
sendValue = tsplus_module_17.nothing();
|
|
2077
|
+
subscriber.next(value);
|
|
2078
|
+
!isComplete && startThrottling(value);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2082
|
+
next: value => {
|
|
2083
|
+
sendValue = tsplus_module_17.just(value);
|
|
2084
|
+
!(throttled && !throttled.closed) && (leading ? send() : startThrottling(value));
|
|
2085
|
+
},
|
|
2086
|
+
complete: () => {
|
|
2087
|
+
isComplete = true;
|
|
2088
|
+
!(trailing && tsplus_module_18.isJust(sendValue) && throttled && !throttled.closed) && subscriber.complete();
|
|
2089
|
+
}
|
|
2090
|
+
}));
|
|
2091
|
+
})(fa);
|
|
2092
|
+
};
|
|
2293
2093
|
}
|
|
2294
2094
|
/**
|
|
2295
|
-
* @tsplus
|
|
2095
|
+
* @tsplus pipeable fncts.observable.Observable throttleTime
|
|
2296
2096
|
*/
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2097
|
+
function throttleTime(duration, scheduler = tsplus_module_5.asyncScheduler, config = defaultThrottleConfig) {
|
|
2098
|
+
return fa => {
|
|
2099
|
+
const duration$ = timer_1(duration, scheduler);
|
|
2100
|
+
return throttle_1(() => duration$, config)(fa);
|
|
2101
|
+
};
|
|
2302
2102
|
}
|
|
2303
|
-
|
|
2304
2103
|
class TimeoutError extends Error {
|
|
2305
2104
|
constructor(info) {
|
|
2306
2105
|
super("Timeout has occurred");
|
|
2307
2106
|
this.info = info;
|
|
2308
2107
|
this.name = "TimeoutError";
|
|
2309
2108
|
}
|
|
2310
|
-
|
|
2311
2109
|
}
|
|
2312
|
-
|
|
2313
2110
|
exports.TimeoutError = TimeoutError;
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
})
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
|
|
2357
|
-
});
|
|
2111
|
+
function timeout(config) {
|
|
2112
|
+
return fa => {
|
|
2113
|
+
const {
|
|
2114
|
+
first,
|
|
2115
|
+
each,
|
|
2116
|
+
with: _with = timeoutError,
|
|
2117
|
+
scheduler = tsplus_module_5.asyncScheduler,
|
|
2118
|
+
meta = null
|
|
2119
|
+
} = config;
|
|
2120
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2121
|
+
// eslint-disable-next-line prefer-const
|
|
2122
|
+
let originalSourceSubscription;
|
|
2123
|
+
let timerSubscription;
|
|
2124
|
+
let lastValue = tsplus_module_17.nothing();
|
|
2125
|
+
let seen = 0;
|
|
2126
|
+
const startTimer = delay => {
|
|
2127
|
+
timerSubscription = (0, tsplus_module_7.caughtSchedule)(subscriber, scheduler, () => {
|
|
2128
|
+
originalSourceSubscription.unsubscribe();
|
|
2129
|
+
from_1(_with({
|
|
2130
|
+
meta,
|
|
2131
|
+
lastValue,
|
|
2132
|
+
seen
|
|
2133
|
+
})).provideEnvironment(environment).subscribe(subscriber);
|
|
2134
|
+
}, delay);
|
|
2135
|
+
};
|
|
2136
|
+
originalSourceSubscription = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2137
|
+
next: value => {
|
|
2138
|
+
timerSubscription?.unsubscribe();
|
|
2139
|
+
seen++;
|
|
2140
|
+
lastValue = tsplus_module_17.just(value);
|
|
2141
|
+
subscriber.next(value);
|
|
2142
|
+
each > 0 && startTimer(each);
|
|
2143
|
+
}
|
|
2144
|
+
}, () => {
|
|
2145
|
+
if (!timerSubscription?.closed) {
|
|
2146
|
+
timerSubscription?.unsubscribe();
|
|
2147
|
+
}
|
|
2148
|
+
lastValue = tsplus_module_17.nothing();
|
|
2149
|
+
}));
|
|
2150
|
+
startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
|
|
2151
|
+
})(fa);
|
|
2152
|
+
};
|
|
2358
2153
|
}
|
|
2359
|
-
|
|
2360
2154
|
function timeoutError(info) {
|
|
2361
2155
|
return fail_1(new TimeoutError(info));
|
|
2362
2156
|
}
|
|
2363
|
-
|
|
2364
2157
|
function toArrayAccumulator(arr, value) {
|
|
2365
2158
|
return arr.push(value), arr;
|
|
2366
2159
|
}
|
|
2367
2160
|
/**
|
|
2368
2161
|
* @tsplus getter fncts.observable.Observable toArray
|
|
2369
2162
|
*/
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
2163
|
function toArray_1(fa) {
|
|
2373
|
-
return tsplus_module_8.operate_(
|
|
2374
|
-
foldLeft_1(
|
|
2375
|
-
});
|
|
2164
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2165
|
+
foldLeft_1([], toArrayAccumulator)(source).provideEnvironment(environment).subscribe(subscriber);
|
|
2166
|
+
})(fa);
|
|
2376
2167
|
}
|
|
2377
2168
|
/**
|
|
2378
|
-
* @tsplus
|
|
2169
|
+
* @tsplus pipeable fncts.observable.Observable unique
|
|
2379
2170
|
*/
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
subscriber.next(value);
|
|
2171
|
+
function unique(toKey, flushes) {
|
|
2172
|
+
return fa => {
|
|
2173
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2174
|
+
let distinctKeys = tsplus_module_21.empty();
|
|
2175
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2176
|
+
next: value => {
|
|
2177
|
+
const key = toKey ? toKey(value) : value;
|
|
2178
|
+
if (!tsplus_module_21.has(key)(distinctKeys)) {
|
|
2179
|
+
tsplus_module_21.add(key)(distinctKeys);
|
|
2180
|
+
subscriber.next(value);
|
|
2181
|
+
}
|
|
2392
2182
|
}
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
}));
|
|
2399
|
-
}
|
|
2183
|
+
}));
|
|
2184
|
+
flushes?.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2185
|
+
next: () => distinctKeys = tsplus_module_21.empty(),
|
|
2186
|
+
complete: tsplus_module_2.noop
|
|
2187
|
+
}));
|
|
2188
|
+
})(fa);
|
|
2189
|
+
};
|
|
2400
2190
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2191
|
+
function uniqueUntilChanged_1(E, keySelector = tsplus_module_13.identity) {
|
|
2192
|
+
return fa => {
|
|
2193
|
+
const compare = "equals" in E ? E.equals : E;
|
|
2194
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2195
|
+
let previousKey;
|
|
2196
|
+
let first = true;
|
|
2197
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2198
|
+
next: value => {
|
|
2199
|
+
const currentKey = keySelector(value);
|
|
2200
|
+
if (first || !compare(previousKey, currentKey)) {
|
|
2201
|
+
first = false;
|
|
2202
|
+
previousKey = currentKey;
|
|
2203
|
+
subscriber.next(value);
|
|
2204
|
+
}
|
|
2415
2205
|
}
|
|
2416
|
-
}
|
|
2417
|
-
}));
|
|
2418
|
-
}
|
|
2206
|
+
}));
|
|
2207
|
+
})(fa);
|
|
2208
|
+
};
|
|
2419
2209
|
}
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2210
|
+
function uniqueUntilKeyChanged(key, equals) {
|
|
2211
|
+
if ("equals" in equals) {
|
|
2212
|
+
return fa => uniqueUntilChanged_1((x, y) => equals.equals(y[key])(x[key]))(fa);
|
|
2213
|
+
} else {
|
|
2214
|
+
return fa => uniqueUntilChanged_1((x, y) => equals(x[key], y[key]))(fa);
|
|
2215
|
+
}
|
|
2424
2216
|
}
|
|
2425
|
-
|
|
2426
|
-
function combineLatestInternal(subscriber, observables, scheduler, valueTransform = tsplus_module_13.identity) {
|
|
2217
|
+
function combineLatestInternal(subscriber, environment, observables, scheduler, valueTransform = tsplus_module_13.identity) {
|
|
2427
2218
|
return maybeSchedule(subscriber, scheduler, () => {
|
|
2428
2219
|
const {
|
|
2429
2220
|
length
|
|
@@ -2431,20 +2222,17 @@ function combineLatestInternal(subscriber, observables, scheduler, valueTransfor
|
|
|
2431
2222
|
const values = new Array(length);
|
|
2432
2223
|
let active = length;
|
|
2433
2224
|
let remainingFirstValues = length;
|
|
2434
|
-
|
|
2435
2225
|
for (let i = 0; i < length; i++) {
|
|
2436
2226
|
maybeSchedule(subscriber, scheduler, () => {
|
|
2437
|
-
const source = scheduler ? scheduled_1(observables[i]
|
|
2227
|
+
const source = scheduler ? scheduled_1(scheduler)(observables[i]) : from_1(observables[i]);
|
|
2438
2228
|
let hasFirstValue = false;
|
|
2439
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2229
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2440
2230
|
next: value => {
|
|
2441
2231
|
values[i] = value;
|
|
2442
|
-
|
|
2443
2232
|
if (!hasFirstValue) {
|
|
2444
2233
|
hasFirstValue = true;
|
|
2445
2234
|
remainingFirstValues--;
|
|
2446
2235
|
}
|
|
2447
|
-
|
|
2448
2236
|
if (!remainingFirstValues) {
|
|
2449
2237
|
subscriber.next(valueTransform(values.slice()));
|
|
2450
2238
|
}
|
|
@@ -2459,15 +2247,13 @@ function combineLatestInternal(subscriber, observables, scheduler, valueTransfor
|
|
|
2459
2247
|
}
|
|
2460
2248
|
});
|
|
2461
2249
|
}
|
|
2462
|
-
|
|
2463
2250
|
function findInternal(predicate, emit) {
|
|
2464
2251
|
const findIndex = emit === "index";
|
|
2465
|
-
return (source, subscriber) => {
|
|
2252
|
+
return (source, subscriber, environment) => {
|
|
2466
2253
|
let index = 0;
|
|
2467
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2254
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2468
2255
|
next: value => {
|
|
2469
2256
|
const i = index++;
|
|
2470
|
-
|
|
2471
2257
|
if (predicate(index++, value)) {
|
|
2472
2258
|
subscriber.next(findIndex ? i : tsplus_module_17.just(value));
|
|
2473
2259
|
subscriber.complete();
|
|
@@ -2480,11 +2266,9 @@ function findInternal(predicate, emit) {
|
|
|
2480
2266
|
}));
|
|
2481
2267
|
};
|
|
2482
2268
|
}
|
|
2483
|
-
|
|
2484
2269
|
function joinAllInternal(fa, joiner) {
|
|
2485
|
-
return mergeMap_1(toArray_1(fa)
|
|
2270
|
+
return mergeMap_1(joiner)(toArray_1(fa));
|
|
2486
2271
|
}
|
|
2487
|
-
|
|
2488
2272
|
function maybeSchedule(subscription, scheduler, execute) {
|
|
2489
2273
|
if (scheduler) {
|
|
2490
2274
|
subscription.add(scheduler.schedule(execute));
|
|
@@ -2492,29 +2276,24 @@ function maybeSchedule(subscription, scheduler, execute) {
|
|
|
2492
2276
|
execute();
|
|
2493
2277
|
}
|
|
2494
2278
|
}
|
|
2495
|
-
|
|
2496
|
-
function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
|
|
2279
|
+
function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
|
|
2497
2280
|
const buffer = [];
|
|
2498
2281
|
let active = 0;
|
|
2499
2282
|
let index = 0;
|
|
2500
2283
|
let isComplete = false;
|
|
2501
|
-
|
|
2502
2284
|
const checkComplete = () => {
|
|
2503
2285
|
if (isComplete && !buffer.length && !active) {
|
|
2504
2286
|
subscriber.complete();
|
|
2505
2287
|
}
|
|
2506
2288
|
};
|
|
2507
|
-
|
|
2508
2289
|
const outerNext = a => active < concurrent ? doInnerSub(a) : buffer.push(a);
|
|
2509
|
-
|
|
2510
2290
|
const doInnerSub = a => {
|
|
2511
2291
|
expand && subscriber.next(a);
|
|
2512
2292
|
active++;
|
|
2513
2293
|
let innerComplete = false;
|
|
2514
|
-
from_1(f(index++, a)).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2294
|
+
from_1(f(index++, a)).provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2515
2295
|
next: b => {
|
|
2516
2296
|
onBeforeNext?.(b);
|
|
2517
|
-
|
|
2518
2297
|
if (expand) {
|
|
2519
2298
|
outerNext(b);
|
|
2520
2299
|
} else {
|
|
@@ -2528,12 +2307,10 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2528
2307
|
if (innerComplete) {
|
|
2529
2308
|
try {
|
|
2530
2309
|
active--;
|
|
2531
|
-
|
|
2532
2310
|
while (buffer.length && active < concurrent) {
|
|
2533
2311
|
const bufferedValue = buffer.shift();
|
|
2534
2312
|
innerSubScheduler ? subscriber.add(innerSubScheduler.schedule(() => doInnerSub(bufferedValue))) : doInnerSub(bufferedValue);
|
|
2535
2313
|
}
|
|
2536
|
-
|
|
2537
2314
|
checkComplete();
|
|
2538
2315
|
} catch (err) {
|
|
2539
2316
|
subscriber.error(tsplus_module_1.halt(err));
|
|
@@ -2541,8 +2318,7 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2541
2318
|
}
|
|
2542
2319
|
}));
|
|
2543
2320
|
};
|
|
2544
|
-
|
|
2545
|
-
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2321
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2546
2322
|
next: outerNext,
|
|
2547
2323
|
complete: () => {
|
|
2548
2324
|
isComplete = true;
|
|
@@ -2553,13 +2329,12 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2553
2329
|
additionalTeardown?.();
|
|
2554
2330
|
};
|
|
2555
2331
|
}
|
|
2556
|
-
|
|
2557
2332
|
function scanInternal(f, initial, hasInitial, emitOnNext, emitBeforeComplete) {
|
|
2558
|
-
return (source, subscriber) => {
|
|
2333
|
+
return (source, subscriber, environment) => {
|
|
2559
2334
|
let hasState = hasInitial;
|
|
2560
2335
|
let state = initial;
|
|
2561
2336
|
let index = 0;
|
|
2562
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2337
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2563
2338
|
next: value => {
|
|
2564
2339
|
const i = index++;
|
|
2565
2340
|
state = hasState ? f(i, state, value) : (hasState = true, value);
|