@fncts/observable 0.0.8 → 0.0.10
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 +188 -194
- package/Observable/definition.d.ts +8 -6
- package/Operator.d.ts +2 -2
- package/_cjs/Action.cjs.map +1 -1
- package/_cjs/AnimationFrameAction.cjs.map +1 -1
- package/_cjs/AnimationFrameScheduler.cjs +0 -1
- package/_cjs/AnimationFrameScheduler.cjs.map +1 -1
- package/_cjs/BehaviorSubject.cjs +1 -1
- package/_cjs/BehaviorSubject.cjs.map +1 -1
- package/_cjs/Notification.cjs +21 -17
- package/_cjs/Notification.cjs.map +1 -1
- package/_cjs/Observable/api/connect.cjs +12 -10
- package/_cjs/Observable/api/connect.cjs.map +1 -1
- package/_cjs/Observable/api/connectable.cjs +6 -4
- package/_cjs/Observable/api/connectable.cjs.map +1 -1
- package/_cjs/Observable/api/fromCallback.cjs.map +1 -1
- package/_cjs/Observable/api/fromEvent.cjs +3 -0
- package/_cjs/Observable/api/fromEvent.cjs.map +1 -1
- package/_cjs/Observable/api/race.cjs +2 -2
- package/_cjs/Observable/api/race.cjs.map +1 -1
- package/_cjs/Observable/api/raceWith.cjs +8 -6
- package/_cjs/Observable/api/raceWith.cjs.map +1 -1
- package/_cjs/Observable/api/repeatWhen.cjs +46 -46
- package/_cjs/Observable/api/repeatWhen.cjs.map +1 -1
- package/_cjs/Observable/api/retryWhen.cjs +31 -38
- package/_cjs/Observable/api/retryWhen.cjs.map +1 -1
- package/_cjs/Observable/api/share.cjs +66 -64
- package/_cjs/Observable/api/share.cjs.map +1 -1
- package/_cjs/Observable/api/window.cjs +35 -33
- package/_cjs/Observable/api/window.cjs.map +1 -1
- package/_cjs/Observable/api/windowCount.cjs +41 -39
- package/_cjs/Observable/api/windowCount.cjs.map +1 -1
- package/_cjs/Observable/api/windowTime.cjs +66 -64
- package/_cjs/Observable/api/windowTime.cjs.map +1 -1
- package/_cjs/Observable/api/windowToggle.cjs +63 -61
- package/_cjs/Observable/api/windowToggle.cjs.map +1 -1
- package/_cjs/Observable/api/windowWhen.cjs +43 -41
- package/_cjs/Observable/api/windowWhen.cjs.map +1 -1
- package/_cjs/Observable/api.cjs +1270 -1105
- package/_cjs/Observable/api.cjs.map +1 -1
- package/_cjs/Observable/definition.cjs +9 -8
- package/_cjs/Observable/definition.cjs.map +1 -1
- package/_cjs/Observable/dom/animationFrames.cjs.map +1 -1
- package/_cjs/Observable.cjs.map +1 -1
- package/_cjs/Operator.cjs +11 -9
- package/_cjs/Operator.cjs.map +1 -1
- package/_cjs/Scheduler.cjs +0 -5
- package/_cjs/Scheduler.cjs.map +1 -1
- package/_cjs/Subject.cjs +3 -3
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/Subscriber.cjs.map +1 -1
- package/_cjs/internal/util.cjs.map +1 -1
- package/_mjs/Action.mjs.map +1 -1
- package/_mjs/AnimationFrameAction.mjs.map +1 -1
- package/_mjs/AnimationFrameScheduler.mjs +0 -2
- package/_mjs/AnimationFrameScheduler.mjs.map +1 -1
- package/_mjs/BehaviorSubject.mjs +1 -1
- package/_mjs/BehaviorSubject.mjs.map +1 -1
- package/_mjs/Notification.mjs +18 -14
- package/_mjs/Notification.mjs.map +1 -1
- package/_mjs/Observable/api/connect.mjs +12 -10
- package/_mjs/Observable/api/connect.mjs.map +1 -1
- package/_mjs/Observable/api/connectable.mjs +6 -4
- package/_mjs/Observable/api/connectable.mjs.map +1 -1
- package/_mjs/Observable/api/fromCallback.mjs.map +1 -1
- package/_mjs/Observable/api/fromEvent.mjs +4 -0
- package/_mjs/Observable/api/fromEvent.mjs.map +1 -1
- package/_mjs/Observable/api/race.mjs +2 -2
- package/_mjs/Observable/api/race.mjs.map +1 -1
- package/_mjs/Observable/api/raceWith.mjs +7 -5
- package/_mjs/Observable/api/raceWith.mjs.map +1 -1
- package/_mjs/Observable/api/repeatWhen.mjs +47 -44
- package/_mjs/Observable/api/repeatWhen.mjs.map +1 -1
- package/_mjs/Observable/api/retryWhen.mjs +30 -33
- package/_mjs/Observable/api/retryWhen.mjs.map +1 -1
- package/_mjs/Observable/api/share.mjs +63 -61
- package/_mjs/Observable/api/share.mjs.map +1 -1
- package/_mjs/Observable/api/window.mjs +32 -30
- package/_mjs/Observable/api/window.mjs.map +1 -1
- package/_mjs/Observable/api/windowCount.mjs +40 -38
- package/_mjs/Observable/api/windowCount.mjs.map +1 -1
- package/_mjs/Observable/api/windowTime.mjs +60 -58
- package/_mjs/Observable/api/windowTime.mjs.map +1 -1
- package/_mjs/Observable/api/windowToggle.mjs +56 -54
- package/_mjs/Observable/api/windowToggle.mjs.map +1 -1
- package/_mjs/Observable/api/windowWhen.mjs +42 -40
- package/_mjs/Observable/api/windowWhen.mjs.map +1 -1
- package/_mjs/Observable/api.mjs +1198 -1031
- package/_mjs/Observable/api.mjs.map +1 -1
- package/_mjs/Observable/definition.mjs +9 -8
- package/_mjs/Observable/definition.mjs.map +1 -1
- package/_mjs/Observable/dom/animationFrames.mjs.map +1 -1
- package/_mjs/Observable.mjs.map +1 -1
- package/_mjs/Operator.mjs +11 -9
- package/_mjs/Operator.mjs.map +1 -1
- package/_mjs/Scheduler.mjs +0 -6
- package/_mjs/Scheduler.mjs.map +1 -1
- package/_mjs/Subject.mjs +3 -3
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/Subscriber.mjs.map +1 -1
- 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 +1489 -1495
- 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/Operator.ts +20 -15
- package/_src/Scheduler.ts +0 -6
- package/_src/Subject.ts +1 -1
- package/_src/Subscriber.ts +3 -2
- package/_src/internal/util.ts +8 -4
- 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,31 +94,33 @@ 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;
|
|
122
|
+
exports.zipWith = exports.zipLatest = void 0;
|
|
123
|
+
exports.zipWithLatest = zipWithLatest;
|
|
126
124
|
|
|
127
125
|
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
|
|
128
126
|
|
|
@@ -205,42 +203,42 @@ const mapWithIndex = mapWithIndex_1;
|
|
|
205
203
|
exports.mapWithIndex = mapWithIndex;
|
|
206
204
|
const map_ = map_1;
|
|
207
205
|
exports.map_ = map_;
|
|
208
|
-
const
|
|
209
|
-
exports.
|
|
210
|
-
const
|
|
211
|
-
exports.
|
|
206
|
+
const as = as_1;
|
|
207
|
+
exports.as = as;
|
|
208
|
+
const filterWithIndex = filterWithIndex_1;
|
|
209
|
+
exports.filterWithIndex = filterWithIndex;
|
|
212
210
|
const filterMapWithIndex = filterMapWithIndex_1;
|
|
213
211
|
exports.filterMapWithIndex = filterMapWithIndex;
|
|
214
212
|
const partitionWithIndex = partitionWithIndex_1;
|
|
215
213
|
exports.partitionWithIndex = partitionWithIndex;
|
|
216
|
-
const
|
|
217
|
-
exports.
|
|
214
|
+
const partitionMapWithIndex = partitionMapWithIndex_1;
|
|
215
|
+
exports.partitionMapWithIndex = partitionMapWithIndex;
|
|
218
216
|
const mergeMapWithIndex = mergeMapWithIndex_1;
|
|
219
217
|
exports.mergeMapWithIndex = mergeMapWithIndex;
|
|
220
|
-
const
|
|
221
|
-
exports.
|
|
218
|
+
const mergeMap = mergeMap_1;
|
|
219
|
+
exports.mergeMap = mergeMap;
|
|
222
220
|
const contramapEnvironment = contramapEnvironment_1;
|
|
223
221
|
exports.contramapEnvironment = contramapEnvironment;
|
|
224
222
|
const foldLeftWithIndex = foldLeftWithIndex_1;
|
|
225
223
|
exports.foldLeftWithIndex = foldLeftWithIndex;
|
|
226
224
|
const foldLeft = foldLeft_1;
|
|
227
225
|
exports.foldLeft = foldLeft;
|
|
228
|
-
const
|
|
229
|
-
exports.
|
|
226
|
+
const audit = audit_1;
|
|
227
|
+
exports.audit = audit;
|
|
230
228
|
const catchAllCause = catchAllCause_1;
|
|
231
229
|
exports.catchAllCause = catchAllCause;
|
|
232
230
|
const concatAll = concatAll_1;
|
|
233
231
|
exports.concatAll = concatAll;
|
|
234
|
-
const
|
|
235
|
-
exports.
|
|
232
|
+
const concat = concat_1;
|
|
233
|
+
exports.concat = concat;
|
|
236
234
|
const countWithIndex = countWithIndex_1;
|
|
237
235
|
exports.countWithIndex = countWithIndex;
|
|
238
|
-
const
|
|
239
|
-
exports.
|
|
236
|
+
const zipLatest = zipLatest_1;
|
|
237
|
+
exports.zipLatest = zipLatest;
|
|
240
238
|
const delayWithIndex = delayWithIndex_1;
|
|
241
239
|
exports.delayWithIndex = delayWithIndex;
|
|
242
|
-
const
|
|
243
|
-
exports.
|
|
240
|
+
const delayWith = delayWith_1;
|
|
241
|
+
exports.delayWith = delayWith;
|
|
244
242
|
const exhaustMapWithIndex = exhaustMapWithIndex_1;
|
|
245
243
|
exports.exhaustMapWithIndex = exhaustMapWithIndex;
|
|
246
244
|
const expandWithIndex = expandWithIndex_1;
|
|
@@ -249,34 +247,34 @@ const findWithIndex = findWithIndex_1;
|
|
|
249
247
|
exports.findWithIndex = findWithIndex;
|
|
250
248
|
const findIndexWithIndex = findIndexWithIndex_1;
|
|
251
249
|
exports.findIndexWithIndex = findIndexWithIndex;
|
|
252
|
-
const
|
|
253
|
-
exports.
|
|
250
|
+
const mergeAll = mergeAll_1;
|
|
251
|
+
exports.mergeAll = mergeAll;
|
|
254
252
|
const mergeScanWithIndex = mergeScanWithIndex_1;
|
|
255
253
|
exports.mergeScanWithIndex = mergeScanWithIndex;
|
|
256
|
-
const
|
|
257
|
-
exports.
|
|
258
|
-
const
|
|
259
|
-
exports.
|
|
254
|
+
const onEmpty = onEmpty_1;
|
|
255
|
+
exports.onEmpty = onEmpty;
|
|
256
|
+
const sample = sample_1;
|
|
257
|
+
exports.sample = sample;
|
|
260
258
|
const scanLeftWithIndex = scanLeftWithIndex_1;
|
|
261
259
|
exports.scanLeftWithIndex = scanLeftWithIndex;
|
|
262
260
|
const serviceWithObservable = serviceWithObservable_1;
|
|
263
261
|
exports.serviceWithObservable = serviceWithObservable;
|
|
264
262
|
const switchMapWithIndex = switchMapWithIndex_1;
|
|
265
263
|
exports.switchMapWithIndex = switchMapWithIndex;
|
|
266
|
-
const
|
|
267
|
-
exports.
|
|
264
|
+
const switchMap = switchMap_1;
|
|
265
|
+
exports.switchMap = switchMap;
|
|
268
266
|
const switchScanWithIndex = switchScanWithIndex_1;
|
|
269
267
|
exports.switchScanWithIndex = switchScanWithIndex;
|
|
270
|
-
const
|
|
271
|
-
exports.
|
|
268
|
+
const take = take_1;
|
|
269
|
+
exports.take = take;
|
|
272
270
|
const takeWhileWithIndex = takeWhileWithIndex_1;
|
|
273
271
|
exports.takeWhileWithIndex = takeWhileWithIndex;
|
|
274
|
-
const
|
|
275
|
-
exports.
|
|
272
|
+
const throttle = throttle_1;
|
|
273
|
+
exports.throttle = throttle;
|
|
276
274
|
const toArray = toArray_1;
|
|
277
275
|
exports.toArray = toArray;
|
|
278
|
-
const
|
|
279
|
-
exports.
|
|
276
|
+
const uniqueUntilChanged = uniqueUntilChanged_1;
|
|
277
|
+
exports.uniqueUntilChanged = uniqueUntilChanged;
|
|
280
278
|
|
|
281
279
|
/**
|
|
282
280
|
* @tsplus static fncts.observable.ObservableOps halt
|
|
@@ -290,8 +288,8 @@ function halt(defect) {
|
|
|
290
288
|
|
|
291
289
|
|
|
292
290
|
function defer_1(observable) {
|
|
293
|
-
return new _definition2.Observable(s => {
|
|
294
|
-
from_1(observable()).subscribe(s);
|
|
291
|
+
return new _definition2.Observable((s, environment) => {
|
|
292
|
+
from_1(observable()).provideEnvironment(environment).subscribe(s);
|
|
295
293
|
});
|
|
296
294
|
}
|
|
297
295
|
/**
|
|
@@ -476,7 +474,7 @@ function interval_1(period = 0, scheduler = tsplus_module_5.asyncScheduler) {
|
|
|
476
474
|
|
|
477
475
|
function merge(...sources) {
|
|
478
476
|
const concurrency = (0, _args.popNumber)(sources, Infinity);
|
|
479
|
-
return !sources.length ? empty_1() : sources.length === 1 ? from_1(sources[0]) : mergeAll_1(fromArrayLike(sources)
|
|
477
|
+
return !sources.length ? empty_1() : sources.length === 1 ? from_1(sources[0]) : mergeAll_1(concurrency)(fromArrayLike(sources));
|
|
480
478
|
}
|
|
481
479
|
/**
|
|
482
480
|
* @tsplus static fncts.observable.ObservableOps of
|
|
@@ -498,33 +496,35 @@ function single_1(a) {
|
|
|
498
496
|
});
|
|
499
497
|
}
|
|
500
498
|
/**
|
|
501
|
-
* @tsplus
|
|
499
|
+
* @tsplus pipeable fncts.observable.Observable scheduled
|
|
502
500
|
* @tsplus static fncts.observable.ObservableOps scheduled
|
|
503
501
|
*/
|
|
504
502
|
|
|
505
503
|
|
|
506
|
-
function scheduled_1(
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
504
|
+
function scheduled_1(scheduler) {
|
|
505
|
+
return input => {
|
|
506
|
+
if (tsplus_module_2.isArrayLike(input)) {
|
|
507
|
+
return scheduleArray(input, scheduler);
|
|
508
|
+
}
|
|
510
509
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
510
|
+
if (tsplus_module_2.isPromiseLike(input)) {
|
|
511
|
+
return schedulePromise(input, scheduler);
|
|
512
|
+
}
|
|
514
513
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
514
|
+
if (tsplus_module_3.isIterable(input)) {
|
|
515
|
+
return scheduleIterable(input, scheduler);
|
|
516
|
+
}
|
|
518
517
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
518
|
+
if (tsplus_module_2.isAsyncIterable(input)) {
|
|
519
|
+
return scheduleAsyncIterable(input, scheduler);
|
|
520
|
+
}
|
|
522
521
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
if (tsplus_module_2.isReadableStream(input)) {
|
|
523
|
+
return scheduleReadableStreamLike(input, scheduler);
|
|
524
|
+
}
|
|
526
525
|
|
|
527
|
-
|
|
526
|
+
return scheduleObservable(from_1(input), scheduler);
|
|
527
|
+
};
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
function scheduleArray(input, scheduler) {
|
|
@@ -588,10 +588,10 @@ function scheduleIterable(input, scheduler) {
|
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
function scheduleObservable(input, scheduler) {
|
|
591
|
-
return new _definition2.Observable(subscriber => {
|
|
591
|
+
return new _definition2.Observable((subscriber, environment) => {
|
|
592
592
|
const sub = new tsplus_module_6.Subscription();
|
|
593
593
|
sub.add(scheduler.schedule(() => {
|
|
594
|
-
sub.add(input.subscribe({
|
|
594
|
+
sub.add(input.provideEnvironment(environment).subscribe({
|
|
595
595
|
next: value => {
|
|
596
596
|
sub.add(scheduler.schedule(() => subscriber.next(value)));
|
|
597
597
|
},
|
|
@@ -664,7 +664,7 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyn
|
|
|
664
664
|
|
|
665
665
|
|
|
666
666
|
function makeZip(...sources) {
|
|
667
|
-
return sources.length ? new _definition2.Observable(subscriber => {
|
|
667
|
+
return sources.length ? new _definition2.Observable((subscriber, environment) => {
|
|
668
668
|
let buffers = sources.map(() => []);
|
|
669
669
|
let completed = sources.map(() => false);
|
|
670
670
|
subscriber.add(() => {
|
|
@@ -672,7 +672,7 @@ function makeZip(...sources) {
|
|
|
672
672
|
});
|
|
673
673
|
|
|
674
674
|
for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
|
|
675
|
-
from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
675
|
+
from_1(sources[sourceIndex]).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
676
676
|
next: value => {
|
|
677
677
|
buffers[sourceIndex].push(value);
|
|
678
678
|
|
|
@@ -706,17 +706,17 @@ function fromIO_1(io, scheduler = tsplus_module_5.asyncScheduler) {
|
|
|
706
706
|
return new _definition2.Observable((s, env) => {
|
|
707
707
|
let fiber;
|
|
708
708
|
const scheduled = scheduler.schedule(() => {
|
|
709
|
-
fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.
|
|
709
|
+
fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.provideEnvironment(env, fileName_1 + ":489:36")(io), fileName_1 + ":489:56");
|
|
710
710
|
fiber.unsafeOnDone(exit => {
|
|
711
711
|
if (!s.closed) {
|
|
712
|
-
tsplus_module_11.
|
|
712
|
+
tsplus_module_11.match(cause => s.error(cause), a => s.next(a))(tsplus_module_11.flatten(exit));
|
|
713
713
|
s.complete();
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
716
|
});
|
|
717
717
|
return () => {
|
|
718
718
|
scheduled.unsubscribe();
|
|
719
|
-
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber, fileName_1 + ":
|
|
719
|
+
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber, fileName_1 + ":502:21"), fileName_1 + ":502:46");
|
|
720
720
|
};
|
|
721
721
|
});
|
|
722
722
|
}
|
|
@@ -727,74 +727,88 @@ function fromIO_1(io, scheduler = tsplus_module_5.asyncScheduler) {
|
|
|
727
727
|
|
|
728
728
|
const unit = /*#__PURE__*/single_1(undefined);
|
|
729
729
|
/**
|
|
730
|
-
* @tsplus
|
|
730
|
+
* @tsplus pipeable fncts.observable.Observable zipWith
|
|
731
731
|
*/
|
|
732
732
|
|
|
733
733
|
exports.unit = unit;
|
|
734
734
|
|
|
735
|
-
function zipWith_1(
|
|
736
|
-
return
|
|
735
|
+
function zipWith_1(fb, f) {
|
|
736
|
+
return fa => {
|
|
737
|
+
return mergeMap_1(a => map_1(b => f(a, b))(fb))(fa);
|
|
738
|
+
};
|
|
737
739
|
}
|
|
738
740
|
/**
|
|
739
|
-
* @tsplus
|
|
741
|
+
* @tsplus pipeable fncts.observable.Observable zip
|
|
740
742
|
*/
|
|
741
743
|
|
|
742
744
|
|
|
743
|
-
function zip(
|
|
744
|
-
return
|
|
745
|
+
function zip(fb) {
|
|
746
|
+
return fa => {
|
|
747
|
+
return zipWith_1(fb, tsplus_module_13.tuple)(fa);
|
|
748
|
+
};
|
|
745
749
|
}
|
|
746
750
|
/**
|
|
747
|
-
* @tsplus
|
|
751
|
+
* @tsplus pipeable fncts.observable.Observable ap
|
|
748
752
|
*/
|
|
749
753
|
|
|
750
754
|
|
|
751
|
-
function ap(
|
|
752
|
-
return
|
|
755
|
+
function ap(fa) {
|
|
756
|
+
return fab => {
|
|
757
|
+
return zipWith_1(fa, (f, a) => f(a))(fab);
|
|
758
|
+
};
|
|
753
759
|
}
|
|
754
760
|
/**
|
|
755
|
-
* @tsplus
|
|
761
|
+
* @tsplus pipeable fncts.observable.Observable mapWithIndex
|
|
756
762
|
*/
|
|
757
763
|
|
|
758
764
|
|
|
759
|
-
function mapWithIndex_1(
|
|
760
|
-
return
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
765
|
+
function mapWithIndex_1(f) {
|
|
766
|
+
return fa => {
|
|
767
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
768
|
+
let i = 0;
|
|
769
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
770
|
+
next: value => {
|
|
771
|
+
subscriber.next(f(i++, value));
|
|
772
|
+
}
|
|
773
|
+
}));
|
|
774
|
+
})(fa);
|
|
775
|
+
};
|
|
768
776
|
}
|
|
769
777
|
/**
|
|
770
|
-
* @tsplus
|
|
778
|
+
* @tsplus pipeable fncts.observable.Observable map
|
|
771
779
|
*/
|
|
772
780
|
|
|
773
781
|
|
|
774
|
-
function map_1(
|
|
775
|
-
return
|
|
782
|
+
function map_1(f) {
|
|
783
|
+
return fa => {
|
|
784
|
+
return mapWithIndex_1((_, a) => f(a))(fa);
|
|
785
|
+
};
|
|
776
786
|
}
|
|
777
787
|
/**
|
|
778
|
-
* @tsplus
|
|
788
|
+
* @tsplus pipeable fncts.observable.Observable as
|
|
779
789
|
*/
|
|
780
790
|
|
|
781
791
|
|
|
782
|
-
function as_1(
|
|
783
|
-
return
|
|
792
|
+
function as_1(b) {
|
|
793
|
+
return fa => {
|
|
794
|
+
return map_1(b)(fa);
|
|
795
|
+
};
|
|
784
796
|
}
|
|
785
797
|
/**
|
|
786
|
-
* @tsplus
|
|
798
|
+
* @tsplus pipeable fncts.observable.Observable mapError
|
|
787
799
|
*/
|
|
788
800
|
|
|
789
801
|
|
|
790
|
-
function
|
|
791
|
-
return
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
802
|
+
function mapError(f) {
|
|
803
|
+
return fa => {
|
|
804
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
805
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
806
|
+
error: err => {
|
|
807
|
+
subscriber.error(tsplus_module_1.map(f)(err));
|
|
808
|
+
}
|
|
809
|
+
}));
|
|
810
|
+
})(fa);
|
|
811
|
+
};
|
|
798
812
|
}
|
|
799
813
|
/**
|
|
800
814
|
* @tsplus getter fncts.observable.Observable swap
|
|
@@ -802,150 +816,170 @@ function mapError_(fa, f) {
|
|
|
802
816
|
|
|
803
817
|
|
|
804
818
|
function swap(fa) {
|
|
805
|
-
return tsplus_module_8.operate_(
|
|
806
|
-
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
819
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
820
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
807
821
|
next: value => {
|
|
808
822
|
subscriber.error(tsplus_module_1.fail(value));
|
|
809
823
|
},
|
|
810
824
|
error: err => {
|
|
811
|
-
tsplus_module_14.
|
|
825
|
+
tsplus_module_14.match(e => {
|
|
812
826
|
subscriber.next(e);
|
|
813
827
|
}, cause => {
|
|
814
828
|
subscriber.error(cause);
|
|
815
|
-
});
|
|
829
|
+
})(tsplus_module_1.failureOrCause(err));
|
|
816
830
|
}
|
|
817
831
|
}));
|
|
818
|
-
});
|
|
832
|
+
})(fa);
|
|
819
833
|
}
|
|
820
834
|
|
|
821
|
-
function filterWithIndex_1(
|
|
822
|
-
return
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
835
|
+
function filterWithIndex_1(predicate) {
|
|
836
|
+
return fa => {
|
|
837
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
838
|
+
let index = 0;
|
|
839
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
840
|
+
next: value => predicate(index++, value) && subscriber.next(value)
|
|
841
|
+
}));
|
|
842
|
+
})(fa);
|
|
843
|
+
};
|
|
828
844
|
}
|
|
829
845
|
|
|
830
|
-
function
|
|
831
|
-
return
|
|
846
|
+
function filter(predicate) {
|
|
847
|
+
return fa => {
|
|
848
|
+
return filterWithIndex_1((_, a) => predicate(a))(fa);
|
|
849
|
+
};
|
|
832
850
|
}
|
|
833
851
|
/**
|
|
834
|
-
* @tsplus
|
|
852
|
+
* @tsplus pipeable fncts.observable.Observable filterMapWithIndex
|
|
835
853
|
*/
|
|
836
854
|
|
|
837
855
|
|
|
838
|
-
function filterMapWithIndex_1(
|
|
839
|
-
return
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
856
|
+
function filterMapWithIndex_1(f) {
|
|
857
|
+
return fa => {
|
|
858
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
859
|
+
let index = 0;
|
|
860
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
861
|
+
next: value => tsplus_module_15.match(() => tsplus_module_2.noop, b => subscriber.next(b))(f(index++, value))
|
|
862
|
+
}));
|
|
863
|
+
})(fa);
|
|
864
|
+
};
|
|
845
865
|
}
|
|
846
866
|
/**
|
|
847
|
-
* @tsplus
|
|
867
|
+
* @tsplus pipeable fncts.observable.Observable filterMap
|
|
848
868
|
*/
|
|
849
869
|
|
|
850
870
|
|
|
851
|
-
function
|
|
852
|
-
return
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
function partitionWithIndex_1(fa, predicate) {
|
|
856
|
-
return [filterWithIndex_1(fa, (i, a) => !predicate(i, a)), filterWithIndex_1(fa, predicate)];
|
|
871
|
+
function filterMap(f) {
|
|
872
|
+
return fa => {
|
|
873
|
+
return filterMapWithIndex_1((_, a) => f(a))(fa);
|
|
874
|
+
};
|
|
857
875
|
}
|
|
858
876
|
|
|
859
|
-
function
|
|
860
|
-
return
|
|
877
|
+
function partitionWithIndex_1(predicate) {
|
|
878
|
+
return fa => {
|
|
879
|
+
return [filterWithIndex_1((i, a) => !predicate(i, a))(fa), filterWithIndex_1(predicate)(fa)];
|
|
880
|
+
};
|
|
861
881
|
}
|
|
862
|
-
/**
|
|
863
|
-
* @tsplus fluent fncts.observable.Observable partitionMapWithIndex
|
|
864
|
-
*/
|
|
865
|
-
|
|
866
882
|
|
|
867
|
-
function
|
|
868
|
-
return
|
|
869
|
-
|
|
870
|
-
|
|
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
|
-
})];
|
|
883
|
+
function partition(predicate) {
|
|
884
|
+
return fa => {
|
|
885
|
+
return partitionWithIndex_1((_, a) => predicate(a))(fa);
|
|
886
|
+
};
|
|
883
887
|
}
|
|
884
888
|
/**
|
|
885
|
-
* @tsplus
|
|
889
|
+
* @tsplus pipeable fncts.observable.Observable partitionMapWithIndex
|
|
886
890
|
*/
|
|
887
891
|
|
|
888
892
|
|
|
889
|
-
function
|
|
890
|
-
return
|
|
893
|
+
function partitionMapWithIndex_1(f) {
|
|
894
|
+
return fa => {
|
|
895
|
+
return [tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
896
|
+
let index = 0;
|
|
897
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
898
|
+
next: value => {
|
|
899
|
+
tsplus_module_14.match(b => subscriber.next(b), tsplus_module_2.noop)(f(index++, value));
|
|
900
|
+
}
|
|
901
|
+
}));
|
|
902
|
+
})(fa), tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
903
|
+
let index = 0;
|
|
904
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
905
|
+
next: value => {
|
|
906
|
+
tsplus_module_14.match(tsplus_module_2.noop, c => subscriber.next(c))(f(index++, value));
|
|
907
|
+
}
|
|
908
|
+
}));
|
|
909
|
+
})(fa)];
|
|
910
|
+
};
|
|
891
911
|
}
|
|
892
912
|
/**
|
|
893
|
-
* @tsplus
|
|
913
|
+
* @tsplus pipeable fncts.observable.Observable partitionMap
|
|
894
914
|
*/
|
|
895
915
|
|
|
896
916
|
|
|
897
|
-
function
|
|
898
|
-
return
|
|
917
|
+
function partitionMap(f) {
|
|
918
|
+
return fa => {
|
|
919
|
+
return partitionMapWithIndex_1((_, a) => f(a))(fa);
|
|
920
|
+
};
|
|
899
921
|
}
|
|
900
922
|
/**
|
|
901
|
-
* @tsplus
|
|
923
|
+
* @tsplus pipeable fncts.observable.Observable provideService
|
|
902
924
|
*/
|
|
903
925
|
|
|
904
926
|
|
|
905
|
-
function provideService(
|
|
927
|
+
function provideService(service,
|
|
906
928
|
/** @tsplus auto */
|
|
907
929
|
tag) {
|
|
908
|
-
return
|
|
930
|
+
return self => {
|
|
931
|
+
return contramapEnvironment_1(environment => tsplus_module_16.add(service, tag)(environment))(self);
|
|
932
|
+
};
|
|
909
933
|
}
|
|
910
934
|
/**
|
|
911
|
-
* @tsplus
|
|
935
|
+
* @tsplus pipeable fncts.observable.Observable mergeMapWithIndex
|
|
912
936
|
*/
|
|
913
937
|
|
|
914
938
|
|
|
915
|
-
function mergeMapWithIndex_1(
|
|
916
|
-
return
|
|
939
|
+
function mergeMapWithIndex_1(f, concurrent = Infinity) {
|
|
940
|
+
return ma => {
|
|
941
|
+
return tsplus_module_8.operate_((source, sub, environment) => mergeInternal(source, sub, environment, f, concurrent))(ma);
|
|
942
|
+
};
|
|
917
943
|
}
|
|
918
944
|
/**
|
|
919
|
-
* @tsplus
|
|
945
|
+
* @tsplus pipeable fncts.observable.Observable mergeMap
|
|
920
946
|
*/
|
|
921
947
|
|
|
922
948
|
|
|
923
|
-
function mergeMap_1(
|
|
924
|
-
return
|
|
949
|
+
function mergeMap_1(f, concurrent = Infinity) {
|
|
950
|
+
return ma => {
|
|
951
|
+
return mergeMapWithIndex_1((_, a) => f(a), concurrent)(ma);
|
|
952
|
+
};
|
|
925
953
|
}
|
|
926
954
|
/**
|
|
927
|
-
* @tsplus
|
|
955
|
+
* @tsplus pipeable fncts.observable.Observable concatMapWithIndex
|
|
928
956
|
*/
|
|
929
957
|
|
|
930
958
|
|
|
931
|
-
function concatMapWithIndex(
|
|
932
|
-
return
|
|
959
|
+
function concatMapWithIndex(f) {
|
|
960
|
+
return ma => {
|
|
961
|
+
return mergeMapWithIndex_1(f, 1)(ma);
|
|
962
|
+
};
|
|
933
963
|
}
|
|
934
964
|
/**
|
|
935
|
-
* @tsplus
|
|
965
|
+
* @tsplus pipeable fncts.observable.Observable concatMap
|
|
936
966
|
*/
|
|
937
967
|
|
|
938
968
|
|
|
939
|
-
function
|
|
940
|
-
return
|
|
969
|
+
function concatMap(f) {
|
|
970
|
+
return ma => {
|
|
971
|
+
return mergeMapWithIndex_1((_, a) => f(a), 1)(ma);
|
|
972
|
+
};
|
|
941
973
|
}
|
|
942
974
|
/**
|
|
943
|
-
* @tsplus
|
|
975
|
+
* @tsplus pipeable fncts.observable.Observable contramapEnvironment
|
|
944
976
|
*/
|
|
945
977
|
|
|
946
978
|
|
|
947
|
-
function contramapEnvironment_1(
|
|
948
|
-
return
|
|
979
|
+
function contramapEnvironment_1(f) {
|
|
980
|
+
return self => {
|
|
981
|
+
return environmentWithObservable_1(environment => self.provideEnvironment(f(environment)));
|
|
982
|
+
};
|
|
949
983
|
}
|
|
950
984
|
/**
|
|
951
985
|
* @tsplus getter fncts.observable.Observable flatten
|
|
@@ -956,336 +990,358 @@ function flatten(mma) {
|
|
|
956
990
|
return concatAll_1(mma);
|
|
957
991
|
}
|
|
958
992
|
/**
|
|
959
|
-
* @tsplus
|
|
993
|
+
* @tsplus pipeable fncts.observable.Observable foldLeftWithIndex
|
|
960
994
|
*/
|
|
961
995
|
|
|
962
996
|
|
|
963
|
-
function foldLeftWithIndex_1(
|
|
964
|
-
return
|
|
997
|
+
function foldLeftWithIndex_1(initial, f) {
|
|
998
|
+
return fa => {
|
|
999
|
+
return tsplus_module_8.operate_(scanInternal(f, initial, true, false, true))(fa);
|
|
1000
|
+
};
|
|
965
1001
|
}
|
|
966
1002
|
/**
|
|
967
|
-
* @tsplus
|
|
1003
|
+
* @tsplus pipeable fncts.observable.Observable foldLeft
|
|
968
1004
|
*/
|
|
969
1005
|
|
|
970
1006
|
|
|
971
|
-
function foldLeft_1(
|
|
972
|
-
return
|
|
1007
|
+
function foldLeft_1(initial, f) {
|
|
1008
|
+
return fa => {
|
|
1009
|
+
return foldLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
1010
|
+
};
|
|
973
1011
|
}
|
|
974
1012
|
/**
|
|
975
|
-
* @tsplus
|
|
1013
|
+
* @tsplus pipeable fncts.observable.Observable at
|
|
976
1014
|
*/
|
|
977
1015
|
|
|
978
1016
|
|
|
979
|
-
function
|
|
980
|
-
return
|
|
1017
|
+
function at(index) {
|
|
1018
|
+
return fa => {
|
|
1019
|
+
return onEmpty_1(() => tsplus_module_17.nothing())(map_1(tsplus_module_17.just)(take_1(1)(filterWithIndex_1(i => i === index)(fa))));
|
|
1020
|
+
};
|
|
981
1021
|
}
|
|
982
1022
|
/**
|
|
983
|
-
* @tsplus
|
|
1023
|
+
* @tsplus pipeable fncts.observable.Observable audit
|
|
984
1024
|
*/
|
|
985
1025
|
|
|
986
1026
|
|
|
987
|
-
function audit_1(
|
|
988
|
-
return
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1027
|
+
function audit_1(durationSelector) {
|
|
1028
|
+
return fa => {
|
|
1029
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1030
|
+
let lastValue = tsplus_module_17.nothing();
|
|
1031
|
+
let durationSubscriber = null;
|
|
1032
|
+
let isComplete = false;
|
|
992
1033
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1034
|
+
const endDuration = () => {
|
|
1035
|
+
durationSubscriber?.unsubscribe();
|
|
1036
|
+
durationSubscriber = null;
|
|
996
1037
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1038
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
1039
|
+
const {
|
|
1040
|
+
value
|
|
1041
|
+
} = lastValue;
|
|
1042
|
+
lastValue = tsplus_module_17.nothing();
|
|
1043
|
+
subscriber.next(value);
|
|
1044
|
+
}
|
|
1004
1045
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1046
|
+
isComplete && subscriber.complete();
|
|
1047
|
+
};
|
|
1007
1048
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1049
|
+
const cleanupDuration = () => {
|
|
1050
|
+
durationSubscriber = null;
|
|
1051
|
+
isComplete && subscriber.complete();
|
|
1052
|
+
};
|
|
1012
1053
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1054
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1055
|
+
next: value => {
|
|
1056
|
+
lastValue = tsplus_module_17.just(value);
|
|
1016
1057
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1058
|
+
if (!durationSubscriber) {
|
|
1059
|
+
from_1(durationSelector(value)).provideEnvironment(environment).subscribe(durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1060
|
+
next: endDuration,
|
|
1061
|
+
complete: cleanupDuration
|
|
1062
|
+
}));
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
complete: () => {
|
|
1066
|
+
isComplete = true;
|
|
1067
|
+
(tsplus_module_18.isNothing(lastValue) || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
1022
1068
|
}
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
(tsplus_module_18.isNothing(lastValue) || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
1027
|
-
}
|
|
1028
|
-
}));
|
|
1029
|
-
});
|
|
1069
|
+
}));
|
|
1070
|
+
})(fa);
|
|
1071
|
+
};
|
|
1030
1072
|
}
|
|
1031
1073
|
/**
|
|
1032
|
-
* @tsplus
|
|
1074
|
+
* @tsplus pipeable fncts.observable.Observable auditTime
|
|
1033
1075
|
*/
|
|
1034
1076
|
|
|
1035
1077
|
|
|
1036
|
-
function
|
|
1037
|
-
return
|
|
1078
|
+
function auditTime(duration, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1079
|
+
return fa => {
|
|
1080
|
+
return audit_1(() => timer_1(duration, scheduler))(fa);
|
|
1081
|
+
};
|
|
1038
1082
|
}
|
|
1039
1083
|
/**
|
|
1040
|
-
* @tsplus
|
|
1084
|
+
* @tsplus pipeable fncts.observable.Observable buffer
|
|
1041
1085
|
*/
|
|
1042
1086
|
|
|
1043
1087
|
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1088
|
+
function buffer(closingNotifier) {
|
|
1089
|
+
return fa => {
|
|
1090
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1091
|
+
let buffer = [];
|
|
1092
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1093
|
+
next: value => buffer.push(value),
|
|
1094
|
+
complete: () => {
|
|
1095
|
+
subscriber.next(buffer);
|
|
1096
|
+
subscriber.complete();
|
|
1097
|
+
}
|
|
1098
|
+
}));
|
|
1099
|
+
closingNotifier.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1100
|
+
next: () => {
|
|
1101
|
+
const b = buffer;
|
|
1102
|
+
buffer = [];
|
|
1103
|
+
subscriber.next(b);
|
|
1104
|
+
},
|
|
1105
|
+
complete: tsplus_module_2.noop
|
|
1106
|
+
}));
|
|
1107
|
+
return () => {
|
|
1108
|
+
buffer = null;
|
|
1109
|
+
};
|
|
1110
|
+
})(fa);
|
|
1111
|
+
};
|
|
1066
1112
|
}
|
|
1067
1113
|
/**
|
|
1068
|
-
* @tsplus
|
|
1114
|
+
* @tsplus pipeable fncts.observable.Observable bufferCount
|
|
1069
1115
|
*/
|
|
1070
1116
|
|
|
1071
1117
|
|
|
1072
|
-
function
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1118
|
+
function bufferCount(bufferSize, startBufferEvery) {
|
|
1119
|
+
return fa => {
|
|
1120
|
+
// eslint-disable-next-line no-param-reassign
|
|
1121
|
+
startBufferEvery = startBufferEvery ?? bufferSize;
|
|
1122
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1123
|
+
let buffers = [];
|
|
1124
|
+
let count = 0;
|
|
1125
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1126
|
+
next: value => {
|
|
1127
|
+
let toEmit = null;
|
|
1081
1128
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1129
|
+
if (count++ % startBufferEvery === 0) {
|
|
1130
|
+
buffers.push([]);
|
|
1131
|
+
}
|
|
1085
1132
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1133
|
+
for (const buffer of buffers) {
|
|
1134
|
+
buffer.push(value);
|
|
1088
1135
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1136
|
+
if (bufferSize <= buffer.length) {
|
|
1137
|
+
toEmit = toEmit ?? [];
|
|
1138
|
+
toEmit.push(buffer);
|
|
1139
|
+
}
|
|
1092
1140
|
}
|
|
1093
|
-
}
|
|
1094
1141
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1142
|
+
if (toEmit) {
|
|
1143
|
+
for (const buffer of toEmit) {
|
|
1144
|
+
(0, tsplus_module_2.arrayRemove)(buffers, buffer);
|
|
1145
|
+
subscriber.next(buffer);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
complete: () => {
|
|
1150
|
+
for (const buffer of buffers) {
|
|
1098
1151
|
subscriber.next(buffer);
|
|
1099
1152
|
}
|
|
1100
|
-
}
|
|
1101
|
-
},
|
|
1102
|
-
complete: () => {
|
|
1103
|
-
for (const buffer of buffers) {
|
|
1104
|
-
subscriber.next(buffer);
|
|
1105
|
-
}
|
|
1106
1153
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1154
|
+
subscriber.complete();
|
|
1155
|
+
}
|
|
1156
|
+
}, () => {
|
|
1157
|
+
buffers = null;
|
|
1158
|
+
}));
|
|
1159
|
+
})(fa);
|
|
1160
|
+
};
|
|
1113
1161
|
}
|
|
1114
1162
|
/**
|
|
1115
|
-
* @tsplus
|
|
1163
|
+
* @tsplus pipeable fncts.observable.Observable bufferTime
|
|
1116
1164
|
*/
|
|
1117
1165
|
|
|
1118
1166
|
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
const {
|
|
1132
|
-
|
|
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 = {
|
|
1167
|
+
function bufferTime(config) {
|
|
1168
|
+
return fa => {
|
|
1169
|
+
const {
|
|
1170
|
+
bufferTimeSpan,
|
|
1171
|
+
bufferCreationInterval = null,
|
|
1172
|
+
maxBufferSize = Infinity,
|
|
1173
|
+
scheduler = tsplus_module_5.asyncScheduler
|
|
1174
|
+
} = config;
|
|
1175
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1176
|
+
let bufferRecords = [];
|
|
1177
|
+
let restartOnEmit = true;
|
|
1178
|
+
|
|
1179
|
+
const emit = record => {
|
|
1180
|
+
const {
|
|
1147
1181
|
buffer,
|
|
1148
1182
|
subs
|
|
1149
|
-
};
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1183
|
+
} = record;
|
|
1184
|
+
subs.unsubscribe();
|
|
1185
|
+
(0, tsplus_module_2.arrayRemove)(bufferRecords, record);
|
|
1186
|
+
subscriber.next(buffer);
|
|
1187
|
+
restartOnEmit && startBuffer();
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
const startBuffer = () => {
|
|
1191
|
+
if (bufferRecords) {
|
|
1192
|
+
const subs = new tsplus_module_6.Subscription();
|
|
1193
|
+
subscriber.add(subs);
|
|
1194
|
+
const buffer = [];
|
|
1195
|
+
const record = {
|
|
1196
|
+
buffer,
|
|
1197
|
+
subs
|
|
1198
|
+
};
|
|
1199
|
+
bufferRecords.push(record);
|
|
1200
|
+
subs.add(scheduler.schedule(() => emit(record), bufferTimeSpan));
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1154
1203
|
|
|
1155
|
-
|
|
1204
|
+
bufferCreationInterval !== null && bufferCreationInterval >= 0 ? subscriber.add(scheduler.schedule(function () {
|
|
1205
|
+
startBuffer();
|
|
1206
|
+
!this.closed && subscriber.add(this.schedule(null, bufferCreationInterval));
|
|
1207
|
+
}, bufferCreationInterval)) : restartOnEmit = true;
|
|
1156
1208
|
startBuffer();
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1209
|
+
const bufferTimeSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1210
|
+
next: value => {
|
|
1211
|
+
const recordsCopy = bufferRecords.slice();
|
|
1212
|
+
|
|
1213
|
+
for (const record of recordsCopy) {
|
|
1214
|
+
const {
|
|
1215
|
+
buffer
|
|
1216
|
+
} = record;
|
|
1217
|
+
buffer.push(value);
|
|
1218
|
+
maxBufferSize <= buffer.length && emit(record);
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
complete: () => {
|
|
1222
|
+
while (bufferRecords?.length) {
|
|
1223
|
+
subscriber.next(bufferRecords.shift().buffer);
|
|
1224
|
+
}
|
|
1163
1225
|
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
} = record;
|
|
1168
|
-
buffer.push(value);
|
|
1169
|
-
maxBufferSize <= buffer.length && emit(record);
|
|
1170
|
-
}
|
|
1171
|
-
},
|
|
1172
|
-
complete: () => {
|
|
1173
|
-
while (bufferRecords?.length) {
|
|
1174
|
-
subscriber.next(bufferRecords.shift().buffer);
|
|
1226
|
+
bufferTimeSubscriber?.unsubscribe();
|
|
1227
|
+
subscriber.complete();
|
|
1228
|
+
subscriber.unsubscribe();
|
|
1175
1229
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
}, () => bufferRecords = null);
|
|
1182
|
-
source.subscribe(bufferTimeSubscriber);
|
|
1183
|
-
});
|
|
1230
|
+
}, () => bufferRecords = null);
|
|
1231
|
+
source.provideEnvironment(environment).subscribe(bufferTimeSubscriber);
|
|
1232
|
+
})(fa);
|
|
1233
|
+
};
|
|
1184
1234
|
}
|
|
1185
1235
|
/**
|
|
1186
|
-
* @tsplus
|
|
1236
|
+
* @tsplus pipeable fncts.observable.Observable bufferToggle
|
|
1187
1237
|
*/
|
|
1188
1238
|
|
|
1189
1239
|
|
|
1190
|
-
function
|
|
1191
|
-
return
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1240
|
+
function bufferToggle(openings, closingSelector) {
|
|
1241
|
+
return fa => {
|
|
1242
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1243
|
+
const buffers = [];
|
|
1244
|
+
from_1(openings).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1245
|
+
next: openValue => {
|
|
1246
|
+
const buffer = [];
|
|
1247
|
+
buffers.push(buffer);
|
|
1248
|
+
const closingSubscription = new tsplus_module_6.Subscription();
|
|
1198
1249
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1250
|
+
const emitBuffer = () => {
|
|
1251
|
+
(0, tsplus_module_2.arrayRemove)(buffers, buffer);
|
|
1252
|
+
subscriber.next(buffer);
|
|
1253
|
+
closingSubscription.unsubscribe();
|
|
1254
|
+
};
|
|
1204
1255
|
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1256
|
+
closingSubscription.add(from_1(closingSelector(openValue)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1257
|
+
next: emitBuffer,
|
|
1258
|
+
complete: tsplus_module_2.noop
|
|
1259
|
+
})));
|
|
1260
|
+
},
|
|
1261
|
+
complete: tsplus_module_2.noop
|
|
1262
|
+
}));
|
|
1263
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1264
|
+
next: value => {
|
|
1265
|
+
for (const buffer of buffers) {
|
|
1266
|
+
buffer.push(value);
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
complete: () => {
|
|
1270
|
+
while (buffers.length > 0) {
|
|
1271
|
+
subscriber.next(buffers.shift());
|
|
1272
|
+
}
|
|
1222
1273
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1274
|
+
subscriber.complete();
|
|
1275
|
+
}
|
|
1276
|
+
}));
|
|
1277
|
+
})(fa);
|
|
1278
|
+
};
|
|
1227
1279
|
}
|
|
1228
1280
|
/**
|
|
1229
|
-
* @tsplus
|
|
1281
|
+
* @tsplus pipeable fncts.observable.Observable bufferWhen
|
|
1230
1282
|
*/
|
|
1231
1283
|
|
|
1232
1284
|
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1235
|
-
|
|
1236
|
-
|
|
1285
|
+
function bufferWhen(closingSelector) {
|
|
1286
|
+
return fa => {
|
|
1287
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1288
|
+
let buffer = null;
|
|
1289
|
+
let closingSubscriber = null;
|
|
1237
1290
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1291
|
+
const openBuffer = () => {
|
|
1292
|
+
closingSubscriber?.unsubscribe();
|
|
1293
|
+
const b = buffer;
|
|
1294
|
+
buffer = [];
|
|
1295
|
+
b && subscriber.next(b);
|
|
1296
|
+
from_1(closingSelector()).provideEnvironment(environment).subscribe(closingSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1297
|
+
next: openBuffer,
|
|
1298
|
+
complete: tsplus_module_2.noop
|
|
1299
|
+
}));
|
|
1300
|
+
};
|
|
1248
1301
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1302
|
+
openBuffer();
|
|
1303
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1304
|
+
next: value => buffer?.push(value),
|
|
1305
|
+
complete: () => {
|
|
1306
|
+
buffer && subscriber.next(buffer);
|
|
1307
|
+
subscriber.complete();
|
|
1308
|
+
}
|
|
1309
|
+
}, () => buffer = closingSubscriber = null));
|
|
1310
|
+
})(fa);
|
|
1311
|
+
};
|
|
1258
1312
|
}
|
|
1259
1313
|
/**
|
|
1260
|
-
* @tsplus
|
|
1314
|
+
* @tsplus pipeable fncts.observable.Observable catchAllCause
|
|
1261
1315
|
*/
|
|
1262
1316
|
|
|
1263
1317
|
|
|
1264
|
-
function catchAllCause_1(
|
|
1265
|
-
return
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
innerSub
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1318
|
+
function catchAllCause_1(f) {
|
|
1319
|
+
return self => {
|
|
1320
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1321
|
+
let innerSub = null;
|
|
1322
|
+
let syncUnsub = false;
|
|
1323
|
+
let handledResult;
|
|
1324
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1325
|
+
error: cause => {
|
|
1326
|
+
handledResult = from_1(f(cause, catchAllCause_1(f)(source)));
|
|
1327
|
+
|
|
1328
|
+
if (innerSub) {
|
|
1329
|
+
innerSub.unsubscribe();
|
|
1330
|
+
innerSub = null;
|
|
1331
|
+
handledResult.provideEnvironment(environment).subscribe(subscriber);
|
|
1332
|
+
} else {
|
|
1333
|
+
syncUnsub = true;
|
|
1334
|
+
}
|
|
1279
1335
|
}
|
|
1280
|
-
}
|
|
1281
|
-
}));
|
|
1336
|
+
}));
|
|
1282
1337
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1338
|
+
if (syncUnsub) {
|
|
1339
|
+
innerSub.unsubscribe();
|
|
1340
|
+
innerSub = null;
|
|
1341
|
+
handledResult.provideEnvironment(environment).subscribe(subscriber);
|
|
1342
|
+
}
|
|
1343
|
+
})(self);
|
|
1344
|
+
};
|
|
1289
1345
|
}
|
|
1290
1346
|
/**
|
|
1291
1347
|
* @tsplus getter fncts.observable.Observable concatAll
|
|
@@ -1293,17 +1349,19 @@ function catchAllCause_1(self, f) {
|
|
|
1293
1349
|
|
|
1294
1350
|
|
|
1295
1351
|
function concatAll_1(ffa) {
|
|
1296
|
-
return mergeAll_1(
|
|
1352
|
+
return mergeAll_1(1)(ffa);
|
|
1297
1353
|
}
|
|
1298
1354
|
/**
|
|
1299
|
-
* @tsplus
|
|
1355
|
+
* @tsplus pipeable fncts.observable.Observable concat
|
|
1300
1356
|
*/
|
|
1301
1357
|
|
|
1302
1358
|
|
|
1303
|
-
function concat_1(
|
|
1304
|
-
return
|
|
1305
|
-
|
|
1306
|
-
|
|
1359
|
+
function concat_1(...sources) {
|
|
1360
|
+
return fa => {
|
|
1361
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1362
|
+
concatAll_1(fromArrayLike([source, ...sources])).provideEnvironment(environment).subscribe(subscriber);
|
|
1363
|
+
})(fa);
|
|
1364
|
+
};
|
|
1307
1365
|
}
|
|
1308
1366
|
/**
|
|
1309
1367
|
* @tsplus getter fncts.observable.Observable count
|
|
@@ -1311,23 +1369,27 @@ function concat_1(fa, ...sources) {
|
|
|
1311
1369
|
|
|
1312
1370
|
|
|
1313
1371
|
function count(fa) {
|
|
1314
|
-
return foldLeft_1(
|
|
1372
|
+
return foldLeft_1(0, (total, _) => total + 1)(fa);
|
|
1315
1373
|
}
|
|
1316
1374
|
/**
|
|
1317
|
-
* @tsplus
|
|
1375
|
+
* @tsplus pipeable fncts.observable.Observable countWithIndex
|
|
1318
1376
|
*/
|
|
1319
1377
|
|
|
1320
1378
|
|
|
1321
|
-
function countWithIndex_1(
|
|
1322
|
-
return
|
|
1379
|
+
function countWithIndex_1(predicate) {
|
|
1380
|
+
return fa => {
|
|
1381
|
+
return foldLeftWithIndex_1(0, (i, total, v) => predicate(i, v) ? total + 1 : total)(fa);
|
|
1382
|
+
};
|
|
1323
1383
|
}
|
|
1324
1384
|
/**
|
|
1325
|
-
* @tsplus
|
|
1385
|
+
* @tsplus pipeable fncts.observable.Observable countWith
|
|
1326
1386
|
*/
|
|
1327
1387
|
|
|
1328
1388
|
|
|
1329
|
-
function
|
|
1330
|
-
return
|
|
1389
|
+
function countWith(predicate) {
|
|
1390
|
+
return fa => {
|
|
1391
|
+
return countWithIndex_1((_, a) => predicate(a))(fa);
|
|
1392
|
+
};
|
|
1331
1393
|
}
|
|
1332
1394
|
/**
|
|
1333
1395
|
* @tsplus getter fncts.observable.Observable combineLatestAll
|
|
@@ -1335,116 +1397,132 @@ function countWith_(fa, predicate) {
|
|
|
1335
1397
|
|
|
1336
1398
|
|
|
1337
1399
|
function combineLatestAll(fa) {
|
|
1338
|
-
return joinAllInternal(fa, sources => !sources.length ? empty_1() :
|
|
1400
|
+
return joinAllInternal(fa, sources => !sources.length ? empty_1() : zipLatest_1(sources[0], ...sources.slice(1)));
|
|
1339
1401
|
}
|
|
1340
1402
|
/**
|
|
1341
|
-
* @tsplus
|
|
1403
|
+
* @tsplus pipeable fncts.observable.Observable zipLatest
|
|
1342
1404
|
*/
|
|
1343
1405
|
|
|
1344
1406
|
|
|
1345
|
-
function
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1407
|
+
function zipLatest_1(...sources) {
|
|
1408
|
+
return self => {
|
|
1409
|
+
if (!sources.length) {
|
|
1410
|
+
return from_1(self).unsafeCoerce();
|
|
1411
|
+
}
|
|
1349
1412
|
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1413
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1414
|
+
combineLatestInternal(subscriber, environment, [source, ...sources]);
|
|
1415
|
+
})(from_1(self));
|
|
1416
|
+
};
|
|
1353
1417
|
}
|
|
1354
1418
|
/**
|
|
1355
|
-
* @tsplus
|
|
1419
|
+
* @tsplus pipeable fncts.observable.Observable zipWithLatest
|
|
1356
1420
|
*/
|
|
1357
1421
|
|
|
1358
1422
|
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1361
|
-
|
|
1362
|
-
|
|
1423
|
+
function zipWithLatest(that, f) {
|
|
1424
|
+
return self => {
|
|
1425
|
+
return map_1(tsplus_module_13.tupled(f))(zipLatest_1(from_1(that))(self));
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* @tsplus pipeable fncts.observable.Observable debounceWith
|
|
1430
|
+
*/
|
|
1363
1431
|
|
|
1364
|
-
const emit = () => {
|
|
1365
|
-
durationSubscriber?.unsubscribe();
|
|
1366
|
-
durationSubscriber = null;
|
|
1367
1432
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
subscriber.next(value);
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1433
|
+
function debounceWith(durationSelector) {
|
|
1434
|
+
return fa => {
|
|
1435
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1436
|
+
let lastValue = tsplus_module_17.nothing();
|
|
1437
|
+
let durationSubscriber = null;
|
|
1376
1438
|
|
|
1377
|
-
|
|
1378
|
-
next: value => {
|
|
1439
|
+
const emit = () => {
|
|
1379
1440
|
durationSubscriber?.unsubscribe();
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1441
|
+
durationSubscriber = null;
|
|
1442
|
+
|
|
1443
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
1444
|
+
const {
|
|
1445
|
+
value
|
|
1446
|
+
} = lastValue;
|
|
1447
|
+
lastValue = tsplus_module_17.nothing();
|
|
1448
|
+
subscriber.next(value);
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1453
|
+
next: value => {
|
|
1454
|
+
durationSubscriber?.unsubscribe();
|
|
1455
|
+
lastValue = tsplus_module_17.just(value);
|
|
1456
|
+
durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1457
|
+
next: emit,
|
|
1458
|
+
complete: tsplus_module_2.noop
|
|
1459
|
+
});
|
|
1460
|
+
from_1(durationSelector(value)).provideEnvironment(environment).subscribe(durationSubscriber);
|
|
1461
|
+
},
|
|
1462
|
+
complete: () => {
|
|
1463
|
+
emit();
|
|
1464
|
+
subscriber.complete();
|
|
1465
|
+
}
|
|
1466
|
+
}, () => {
|
|
1467
|
+
lastValue = durationSubscriber = null;
|
|
1468
|
+
}));
|
|
1469
|
+
})(fa);
|
|
1470
|
+
};
|
|
1395
1471
|
}
|
|
1396
1472
|
/**
|
|
1397
|
-
* @tsplus
|
|
1473
|
+
* @tsplus pipeable fncts.observable.Observable debounce
|
|
1398
1474
|
*/
|
|
1399
1475
|
|
|
1400
1476
|
|
|
1401
|
-
function
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
const emit = () => {
|
|
1408
|
-
if (activeTask) {
|
|
1409
|
-
activeTask.unsubscribe();
|
|
1410
|
-
activeTask = null;
|
|
1411
|
-
const value = lastValue;
|
|
1412
|
-
lastValue = null;
|
|
1413
|
-
subscriber.next(value);
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
|
|
1417
|
-
function emitWhenIdle() {
|
|
1418
|
-
const targetTime = lastTime + dueTime;
|
|
1419
|
-
const now = scheduler.now();
|
|
1420
|
-
|
|
1421
|
-
if (now < targetTime) {
|
|
1422
|
-
activeTask = this.schedule(undefined, targetTime - now);
|
|
1423
|
-
subscriber.add(activeTask);
|
|
1424
|
-
return;
|
|
1425
|
-
}
|
|
1477
|
+
function debounce(dueTime, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1478
|
+
return fa => {
|
|
1479
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1480
|
+
let activeTask = null;
|
|
1481
|
+
let lastValue = null;
|
|
1482
|
+
let lastTime = null;
|
|
1426
1483
|
|
|
1427
|
-
emit()
|
|
1428
|
-
|
|
1484
|
+
const emit = () => {
|
|
1485
|
+
if (activeTask) {
|
|
1486
|
+
activeTask.unsubscribe();
|
|
1487
|
+
activeTask = null;
|
|
1488
|
+
const value = lastValue;
|
|
1489
|
+
lastValue = null;
|
|
1490
|
+
subscriber.next(value);
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1429
1493
|
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
lastTime = scheduler.now();
|
|
1494
|
+
function emitWhenIdle() {
|
|
1495
|
+
const targetTime = lastTime + dueTime;
|
|
1496
|
+
const now = scheduler.now();
|
|
1434
1497
|
|
|
1435
|
-
if (
|
|
1436
|
-
activeTask =
|
|
1498
|
+
if (now < targetTime) {
|
|
1499
|
+
activeTask = this.schedule(undefined, targetTime - now);
|
|
1437
1500
|
subscriber.add(activeTask);
|
|
1501
|
+
return;
|
|
1438
1502
|
}
|
|
1439
|
-
|
|
1440
|
-
complete: () => {
|
|
1503
|
+
|
|
1441
1504
|
emit();
|
|
1442
|
-
subscriber.complete();
|
|
1443
1505
|
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1506
|
+
|
|
1507
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1508
|
+
next: value => {
|
|
1509
|
+
lastValue = value;
|
|
1510
|
+
lastTime = scheduler.now();
|
|
1511
|
+
|
|
1512
|
+
if (!activeTask) {
|
|
1513
|
+
activeTask = scheduler.schedule(emitWhenIdle, dueTime);
|
|
1514
|
+
subscriber.add(activeTask);
|
|
1515
|
+
}
|
|
1516
|
+
},
|
|
1517
|
+
complete: () => {
|
|
1518
|
+
emit();
|
|
1519
|
+
subscriber.complete();
|
|
1520
|
+
}
|
|
1521
|
+
}, () => {
|
|
1522
|
+
lastValue = activeTask = null;
|
|
1523
|
+
}));
|
|
1524
|
+
})(fa);
|
|
1525
|
+
};
|
|
1448
1526
|
}
|
|
1449
1527
|
/**
|
|
1450
1528
|
* @tsplus getter fncts.observable.Observable either
|
|
@@ -1452,41 +1530,47 @@ function debounce_(fa, dueTime, scheduler = tsplus_module_5.asyncScheduler) {
|
|
|
1452
1530
|
|
|
1453
1531
|
|
|
1454
1532
|
function either(fa) {
|
|
1455
|
-
return tsplus_module_8.operate_(
|
|
1456
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1533
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1534
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1457
1535
|
next: value => {
|
|
1458
1536
|
subscriber.next(tsplus_module_19.right(value));
|
|
1459
1537
|
},
|
|
1460
1538
|
error: error => {
|
|
1461
|
-
tsplus_module_14.
|
|
1539
|
+
tsplus_module_14.match(e => subscriber.next(tsplus_module_19.left(e)), cause => subscriber.error(cause))(tsplus_module_1.failureOrCause(error));
|
|
1462
1540
|
}
|
|
1463
1541
|
}));
|
|
1464
|
-
});
|
|
1542
|
+
})(fa);
|
|
1465
1543
|
}
|
|
1466
1544
|
/**
|
|
1467
|
-
* @tsplus
|
|
1545
|
+
* @tsplus pipeable fncts.observable.Observable delayWithIndex
|
|
1468
1546
|
*/
|
|
1469
1547
|
|
|
1470
1548
|
|
|
1471
|
-
function delayWithIndex_1(
|
|
1472
|
-
return
|
|
1549
|
+
function delayWithIndex_1(f) {
|
|
1550
|
+
return fa => {
|
|
1551
|
+
return mergeMapWithIndex_1((i, a) => as_1(() => a)(take_1(1)(f(i, a))))(fa);
|
|
1552
|
+
};
|
|
1473
1553
|
}
|
|
1474
1554
|
/**
|
|
1475
|
-
* @tsplus
|
|
1555
|
+
* @tsplus pipeable fncts.observable.Observable delayWith
|
|
1476
1556
|
*/
|
|
1477
1557
|
|
|
1478
1558
|
|
|
1479
|
-
function delayWith_1(
|
|
1480
|
-
return
|
|
1559
|
+
function delayWith_1(f) {
|
|
1560
|
+
return fa => {
|
|
1561
|
+
return delayWithIndex_1((_, a) => f(a))(fa);
|
|
1562
|
+
};
|
|
1481
1563
|
}
|
|
1482
1564
|
/**
|
|
1483
|
-
* @tsplus
|
|
1565
|
+
* @tsplus pipeable fncts.observable.Observable delay
|
|
1484
1566
|
*/
|
|
1485
1567
|
|
|
1486
1568
|
|
|
1487
|
-
function
|
|
1488
|
-
|
|
1489
|
-
|
|
1569
|
+
function delay(due, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1570
|
+
return fa => {
|
|
1571
|
+
const duration = timer_1(due, scheduler);
|
|
1572
|
+
return delayWith_1(() => duration)(fa);
|
|
1573
|
+
};
|
|
1490
1574
|
}
|
|
1491
1575
|
/**
|
|
1492
1576
|
* @tsplus getter fncts.observable.Observable dematerialize
|
|
@@ -1494,22 +1578,24 @@ function delay_(fa, due, scheduler = tsplus_module_5.asyncScheduler) {
|
|
|
1494
1578
|
|
|
1495
1579
|
|
|
1496
1580
|
function dematerialize(fa) {
|
|
1497
|
-
return tsplus_module_8.operate_(
|
|
1498
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1499
|
-
next: notification => tsplus_module_20.
|
|
1581
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1582
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1583
|
+
next: notification => tsplus_module_20.observe(subscriber)(notification)
|
|
1500
1584
|
}));
|
|
1501
|
-
});
|
|
1585
|
+
})(fa);
|
|
1502
1586
|
}
|
|
1503
1587
|
/**
|
|
1504
|
-
* @tsplus
|
|
1588
|
+
* @tsplus pipeable fncts.observable.Observable ensuring
|
|
1505
1589
|
*/
|
|
1506
1590
|
|
|
1507
1591
|
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1592
|
+
function ensuring(finalizer) {
|
|
1593
|
+
return fa => {
|
|
1594
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1595
|
+
source.provideEnvironment(environment).subscribe(subscriber);
|
|
1596
|
+
subscriber.add(finalizer);
|
|
1597
|
+
})(fa);
|
|
1598
|
+
};
|
|
1513
1599
|
}
|
|
1514
1600
|
/**
|
|
1515
1601
|
* @tsplus getter fncts.observable.Observable exhaustAll
|
|
@@ -1517,13 +1603,13 @@ function ensuring_(fa, finalizer) {
|
|
|
1517
1603
|
|
|
1518
1604
|
|
|
1519
1605
|
function exhaustAll(ffa) {
|
|
1520
|
-
return tsplus_module_8.operate_(
|
|
1606
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1521
1607
|
let isComplete = false;
|
|
1522
1608
|
let innerSub = null;
|
|
1523
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1609
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1524
1610
|
next: inner => {
|
|
1525
1611
|
if (!innerSub) {
|
|
1526
|
-
innerSub = from_1(inner).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1612
|
+
innerSub = from_1(inner).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1527
1613
|
complete: () => {
|
|
1528
1614
|
innerSub = null;
|
|
1529
1615
|
isComplete && subscriber.complete();
|
|
@@ -1536,78 +1622,93 @@ function exhaustAll(ffa) {
|
|
|
1536
1622
|
!innerSub && subscriber.complete();
|
|
1537
1623
|
}
|
|
1538
1624
|
}));
|
|
1539
|
-
});
|
|
1625
|
+
})(ffa);
|
|
1540
1626
|
}
|
|
1541
1627
|
/**
|
|
1542
|
-
* @tsplus
|
|
1628
|
+
* @tsplus pipeable fncts.observable.Observable exhaustMapWithIndex
|
|
1543
1629
|
*/
|
|
1544
1630
|
|
|
1545
1631
|
|
|
1546
|
-
function exhaustMapWithIndex_1(
|
|
1547
|
-
return
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1632
|
+
function exhaustMapWithIndex_1(f) {
|
|
1633
|
+
return self => {
|
|
1634
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1635
|
+
let index = 0;
|
|
1636
|
+
let innerSub = null;
|
|
1637
|
+
let isComplete = false;
|
|
1638
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1639
|
+
next: outerValue => {
|
|
1640
|
+
if (!innerSub) {
|
|
1641
|
+
innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1642
|
+
complete: () => {
|
|
1643
|
+
innerSub = null;
|
|
1644
|
+
isComplete && subscriber.complete();
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
from_1(f(index++, outerValue)).provideEnvironment(environment).subscribe(innerSub);
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1650
|
+
complete: () => {
|
|
1651
|
+
isComplete = true;
|
|
1652
|
+
!innerSub && subscriber.complete();
|
|
1561
1653
|
}
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
!innerSub && subscriber.complete();
|
|
1566
|
-
}
|
|
1567
|
-
}));
|
|
1568
|
-
});
|
|
1654
|
+
}));
|
|
1655
|
+
})(self);
|
|
1656
|
+
};
|
|
1569
1657
|
}
|
|
1570
1658
|
/**
|
|
1571
|
-
* @tsplus
|
|
1659
|
+
* @tsplus pipeable fncts.observable.Observable exhaustMap
|
|
1572
1660
|
*/
|
|
1573
1661
|
|
|
1574
1662
|
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1663
|
+
function exhaustMap(f) {
|
|
1664
|
+
return self => {
|
|
1665
|
+
return exhaustMapWithIndex_1((_, a) => f(a))(self);
|
|
1666
|
+
};
|
|
1577
1667
|
}
|
|
1578
1668
|
/**
|
|
1579
|
-
* @tsplus
|
|
1669
|
+
* @tsplus pipeable fncts.observable.Observable expandWithIndex
|
|
1580
1670
|
*/
|
|
1581
1671
|
|
|
1582
1672
|
|
|
1583
|
-
function expandWithIndex_1(
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1673
|
+
function expandWithIndex_1(f, concurrent = Infinity) {
|
|
1674
|
+
return fa => {
|
|
1675
|
+
concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
|
|
1676
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => mergeInternal(source, subscriber, environment, f, concurrent, undefined, true))(fa);
|
|
1677
|
+
};
|
|
1587
1678
|
}
|
|
1588
1679
|
/**
|
|
1589
|
-
* @tsplus
|
|
1680
|
+
* @tsplus pipeable fncts.observable.Observable expand
|
|
1590
1681
|
*/
|
|
1591
1682
|
|
|
1592
1683
|
|
|
1593
|
-
function
|
|
1594
|
-
return
|
|
1684
|
+
function expand(f, concurrent = Infinity) {
|
|
1685
|
+
return fa => {
|
|
1686
|
+
return expandWithIndex_1((_, a) => f(a), concurrent)(fa);
|
|
1687
|
+
};
|
|
1595
1688
|
}
|
|
1596
1689
|
|
|
1597
|
-
function findWithIndex_1(
|
|
1598
|
-
return
|
|
1690
|
+
function findWithIndex_1(predicate) {
|
|
1691
|
+
return fa => {
|
|
1692
|
+
return tsplus_module_8.operate_(findInternal(predicate, "value"))(fa);
|
|
1693
|
+
};
|
|
1599
1694
|
}
|
|
1600
1695
|
|
|
1601
|
-
function
|
|
1602
|
-
return
|
|
1696
|
+
function find(predicate) {
|
|
1697
|
+
return fa => {
|
|
1698
|
+
return findWithIndex_1((_, a) => predicate(a))(fa);
|
|
1699
|
+
};
|
|
1603
1700
|
}
|
|
1604
1701
|
|
|
1605
|
-
function findIndexWithIndex_1(
|
|
1606
|
-
return
|
|
1702
|
+
function findIndexWithIndex_1(predicate) {
|
|
1703
|
+
return fa => {
|
|
1704
|
+
return tsplus_module_8.operate_(findInternal(predicate, "index"))(fa);
|
|
1705
|
+
};
|
|
1607
1706
|
}
|
|
1608
1707
|
|
|
1609
|
-
function
|
|
1610
|
-
return
|
|
1708
|
+
function findIndex(predicate) {
|
|
1709
|
+
return fa => {
|
|
1710
|
+
return findIndexWithIndex_1((_, a) => predicate(a))(fa);
|
|
1711
|
+
};
|
|
1611
1712
|
}
|
|
1612
1713
|
|
|
1613
1714
|
function forkJoin(...args) {
|
|
@@ -1660,11 +1761,11 @@ function forkJoin(...args) {
|
|
|
1660
1761
|
|
|
1661
1762
|
|
|
1662
1763
|
function ignore(fa) {
|
|
1663
|
-
return tsplus_module_8.operate_(
|
|
1664
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1764
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1765
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1665
1766
|
next: tsplus_module_2.noop
|
|
1666
1767
|
}));
|
|
1667
|
-
});
|
|
1768
|
+
})(fa);
|
|
1668
1769
|
}
|
|
1669
1770
|
/**
|
|
1670
1771
|
* @tsplus getter fncts.observable.Observable isEmpty
|
|
@@ -1672,8 +1773,8 @@ function ignore(fa) {
|
|
|
1672
1773
|
|
|
1673
1774
|
|
|
1674
1775
|
function isEmpty(fa) {
|
|
1675
|
-
return tsplus_module_8.operate_(
|
|
1676
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1776
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1777
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1677
1778
|
next: () => {
|
|
1678
1779
|
subscriber.next(false);
|
|
1679
1780
|
subscriber.complete();
|
|
@@ -1683,7 +1784,7 @@ function isEmpty(fa) {
|
|
|
1683
1784
|
subscriber.complete();
|
|
1684
1785
|
}
|
|
1685
1786
|
}));
|
|
1686
|
-
});
|
|
1787
|
+
})(fa);
|
|
1687
1788
|
}
|
|
1688
1789
|
/**
|
|
1689
1790
|
* @tsplus getter fncts.observable.Observable materialize
|
|
@@ -1691,8 +1792,8 @@ function isEmpty(fa) {
|
|
|
1691
1792
|
|
|
1692
1793
|
|
|
1693
1794
|
function materialize(fa) {
|
|
1694
|
-
return tsplus_module_8.operate_(
|
|
1695
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1795
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1796
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1696
1797
|
next: value => {
|
|
1697
1798
|
subscriber.next(tsplus_module_20.next(value));
|
|
1698
1799
|
},
|
|
@@ -1703,40 +1804,46 @@ function materialize(fa) {
|
|
|
1703
1804
|
subscriber.next(tsplus_module_20.complete());
|
|
1704
1805
|
}
|
|
1705
1806
|
}));
|
|
1706
|
-
});
|
|
1807
|
+
})(fa);
|
|
1707
1808
|
}
|
|
1708
1809
|
/**
|
|
1709
|
-
* @tsplus
|
|
1810
|
+
* @tsplus pipeable fncts.observable.Observable mergeAll
|
|
1710
1811
|
*/
|
|
1711
1812
|
|
|
1712
1813
|
|
|
1713
|
-
function mergeAll_1(
|
|
1714
|
-
return
|
|
1814
|
+
function mergeAll_1(concurrent = Infinity) {
|
|
1815
|
+
return self => {
|
|
1816
|
+
return mergeMap_1(tsplus_module_13.identity, concurrent)(self);
|
|
1817
|
+
};
|
|
1715
1818
|
}
|
|
1716
1819
|
/**
|
|
1717
|
-
* @tsplus
|
|
1820
|
+
* @tsplus pipeable fncts.observable.Observable mergeScanWithIndex
|
|
1718
1821
|
*/
|
|
1719
1822
|
|
|
1720
1823
|
|
|
1721
|
-
function mergeScanWithIndex_1(
|
|
1722
|
-
return
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
state
|
|
1726
|
-
|
|
1727
|
-
|
|
1824
|
+
function mergeScanWithIndex_1(initial, f, concurrent = Infinity) {
|
|
1825
|
+
return fa => {
|
|
1826
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1827
|
+
let state = initial;
|
|
1828
|
+
return mergeInternal(source, subscriber, environment, (index, value) => f(index, state, value), concurrent, value => {
|
|
1829
|
+
state = value;
|
|
1830
|
+
}, false, undefined, () => state = null);
|
|
1831
|
+
})(fa);
|
|
1832
|
+
};
|
|
1728
1833
|
}
|
|
1729
1834
|
/**
|
|
1730
|
-
* @tsplus
|
|
1835
|
+
* @tsplus pipeable fncts.observable.Observable mergeScan
|
|
1731
1836
|
*/
|
|
1732
1837
|
|
|
1733
1838
|
|
|
1734
|
-
function
|
|
1735
|
-
return
|
|
1839
|
+
function mergeScan(initial, f, concurrent = Infinity) {
|
|
1840
|
+
return fa => {
|
|
1841
|
+
return mergeScanWithIndex_1(initial, (_, b, a) => f(b, a), concurrent)(fa);
|
|
1842
|
+
};
|
|
1736
1843
|
}
|
|
1737
1844
|
|
|
1738
1845
|
function onErrorResumeNext(fa, ...sources) {
|
|
1739
|
-
return tsplus_module_8.operate_(
|
|
1846
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1740
1847
|
const remaining = [source, ...sources];
|
|
1741
1848
|
|
|
1742
1849
|
const subscribeNext = () => {
|
|
@@ -1755,7 +1862,7 @@ function onErrorResumeNext(fa, ...sources) {
|
|
|
1755
1862
|
error: tsplus_module_2.noop,
|
|
1756
1863
|
complete: tsplus_module_2.noop
|
|
1757
1864
|
});
|
|
1758
|
-
subscriber.add(nextSource.subscribe(innerSub));
|
|
1865
|
+
subscriber.add(nextSource.provideEnvironment(environment).subscribe(innerSub));
|
|
1759
1866
|
innerSub.add(subscribeNext);
|
|
1760
1867
|
} else {
|
|
1761
1868
|
subscriber.complete();
|
|
@@ -1764,178 +1871,192 @@ function onErrorResumeNext(fa, ...sources) {
|
|
|
1764
1871
|
};
|
|
1765
1872
|
|
|
1766
1873
|
subscribeNext();
|
|
1767
|
-
});
|
|
1874
|
+
})(fa);
|
|
1768
1875
|
}
|
|
1769
1876
|
/**
|
|
1770
|
-
* @tsplus
|
|
1877
|
+
* @tsplus pipeable fncts.observable.Observable onEmpty
|
|
1771
1878
|
*/
|
|
1772
1879
|
|
|
1773
1880
|
|
|
1774
|
-
function onEmpty_1(
|
|
1775
|
-
return
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1881
|
+
function onEmpty_1(f) {
|
|
1882
|
+
return fa => {
|
|
1883
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1884
|
+
let hasValue = false;
|
|
1885
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1886
|
+
next: value => {
|
|
1887
|
+
hasValue = true;
|
|
1888
|
+
subscriber.next(value);
|
|
1889
|
+
},
|
|
1890
|
+
complete: () => {
|
|
1891
|
+
if (!hasValue) {
|
|
1892
|
+
subscriber.next(f());
|
|
1893
|
+
}
|
|
1786
1894
|
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1895
|
+
subscriber.complete();
|
|
1896
|
+
}
|
|
1897
|
+
}));
|
|
1898
|
+
})(fa);
|
|
1899
|
+
};
|
|
1791
1900
|
}
|
|
1792
1901
|
/**
|
|
1793
|
-
* @tsplus
|
|
1902
|
+
* @tsplus pipeable fncts.observable.Observable repeat
|
|
1794
1903
|
*/
|
|
1795
1904
|
|
|
1796
1905
|
|
|
1797
|
-
function
|
|
1798
|
-
return
|
|
1799
|
-
|
|
1800
|
-
|
|
1906
|
+
function repeat(count = Infinity) {
|
|
1907
|
+
return fa => {
|
|
1908
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1909
|
+
let repeats = 0;
|
|
1910
|
+
let innerSub;
|
|
1801
1911
|
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1912
|
+
const loop = () => {
|
|
1913
|
+
let syncUnsub = false;
|
|
1914
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1915
|
+
complete: () => {
|
|
1916
|
+
if (++repeats < count) {
|
|
1917
|
+
if (innerSub) {
|
|
1918
|
+
innerSub.unsubscribe();
|
|
1919
|
+
innerSub = null;
|
|
1920
|
+
loop();
|
|
1921
|
+
} else {
|
|
1922
|
+
syncUnsub = true;
|
|
1923
|
+
}
|
|
1811
1924
|
} else {
|
|
1812
|
-
|
|
1925
|
+
subscriber.complete;
|
|
1813
1926
|
}
|
|
1814
|
-
} else {
|
|
1815
|
-
subscriber.complete;
|
|
1816
1927
|
}
|
|
1817
|
-
}
|
|
1818
|
-
}));
|
|
1928
|
+
}));
|
|
1819
1929
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1930
|
+
if (syncUnsub) {
|
|
1931
|
+
innerSub.unsubscribe();
|
|
1932
|
+
innerSub = null;
|
|
1933
|
+
loop();
|
|
1934
|
+
}
|
|
1935
|
+
};
|
|
1826
1936
|
|
|
1827
|
-
|
|
1828
|
-
|
|
1937
|
+
loop();
|
|
1938
|
+
})(fa);
|
|
1939
|
+
};
|
|
1829
1940
|
}
|
|
1830
1941
|
|
|
1831
|
-
function
|
|
1832
|
-
|
|
1942
|
+
function retry(configOrCount = Infinity) {
|
|
1943
|
+
return fa => {
|
|
1944
|
+
let config;
|
|
1833
1945
|
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1946
|
+
if (configOrCount && typeof configOrCount === "object") {
|
|
1947
|
+
config = configOrCount;
|
|
1948
|
+
} else {
|
|
1949
|
+
config = {
|
|
1950
|
+
count: configOrCount
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1841
1953
|
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1954
|
+
const {
|
|
1955
|
+
count,
|
|
1956
|
+
resetOnSuccess = false
|
|
1957
|
+
} = config;
|
|
1958
|
+
return count <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
1959
|
+
let retries = 0;
|
|
1960
|
+
let innerSub;
|
|
1961
|
+
|
|
1962
|
+
const loop = () => {
|
|
1963
|
+
let syncUnsub = false;
|
|
1964
|
+
innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1965
|
+
next: value => {
|
|
1966
|
+
if (resetOnSuccess) {
|
|
1967
|
+
retries = 0;
|
|
1968
|
+
}
|
|
1857
1969
|
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1970
|
+
subscriber.next(value);
|
|
1971
|
+
},
|
|
1972
|
+
error: err => {
|
|
1973
|
+
if (retries++ < count) {
|
|
1974
|
+
if (innerSub) {
|
|
1975
|
+
innerSub.unsubscribe();
|
|
1976
|
+
innerSub = null;
|
|
1977
|
+
loop();
|
|
1978
|
+
} else {
|
|
1979
|
+
syncUnsub = true;
|
|
1980
|
+
}
|
|
1866
1981
|
} else {
|
|
1867
|
-
|
|
1982
|
+
subscriber.error(err);
|
|
1868
1983
|
}
|
|
1869
|
-
} else {
|
|
1870
|
-
subscriber.error(err);
|
|
1871
1984
|
}
|
|
1872
|
-
}
|
|
1873
|
-
}));
|
|
1985
|
+
}));
|
|
1874
1986
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1987
|
+
if (syncUnsub) {
|
|
1988
|
+
innerSub.unsubscribe();
|
|
1989
|
+
innerSub = null;
|
|
1990
|
+
loop();
|
|
1991
|
+
}
|
|
1992
|
+
};
|
|
1881
1993
|
|
|
1882
|
-
|
|
1883
|
-
|
|
1994
|
+
loop();
|
|
1995
|
+
})(fa);
|
|
1996
|
+
};
|
|
1884
1997
|
}
|
|
1885
1998
|
/**
|
|
1886
|
-
* @tsplus
|
|
1999
|
+
* @tsplus pipeable fncts.observable.Observable sample
|
|
1887
2000
|
*/
|
|
1888
2001
|
|
|
1889
2002
|
|
|
1890
|
-
function sample_1(
|
|
1891
|
-
return
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
2003
|
+
function sample_1(notifier) {
|
|
2004
|
+
return fa => {
|
|
2005
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2006
|
+
let hasValue = false;
|
|
2007
|
+
let lastValue = null;
|
|
2008
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2009
|
+
next: value => {
|
|
2010
|
+
hasValue = true;
|
|
2011
|
+
lastValue = value;
|
|
2012
|
+
}
|
|
2013
|
+
}));
|
|
1900
2014
|
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
2015
|
+
const emit = () => {
|
|
2016
|
+
if (hasValue) {
|
|
2017
|
+
hasValue = false;
|
|
2018
|
+
const value = lastValue;
|
|
2019
|
+
lastValue = null;
|
|
2020
|
+
subscriber.next(value);
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
1909
2023
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2024
|
+
notifier.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2025
|
+
next: emit,
|
|
2026
|
+
complete: tsplus_module_2.noop
|
|
2027
|
+
}));
|
|
2028
|
+
})(fa);
|
|
2029
|
+
};
|
|
1915
2030
|
}
|
|
1916
2031
|
/**
|
|
1917
|
-
* @tsplus
|
|
2032
|
+
* @tsplus pipeable fncts.observable.Observable sampleTime
|
|
1918
2033
|
*/
|
|
1919
2034
|
|
|
1920
2035
|
|
|
1921
|
-
function
|
|
1922
|
-
return
|
|
2036
|
+
function sampleTime(period, scheduler = tsplus_module_5.asyncScheduler) {
|
|
2037
|
+
return fa => {
|
|
2038
|
+
return sample_1(interval_1(period, scheduler))(fa);
|
|
2039
|
+
};
|
|
1923
2040
|
}
|
|
1924
2041
|
/**
|
|
1925
|
-
* @tsplus
|
|
2042
|
+
* @tsplus pipeable fncts.observable.Observable scanLeftWithIndex
|
|
1926
2043
|
*/
|
|
1927
2044
|
|
|
1928
2045
|
|
|
1929
|
-
function scanLeftWithIndex_1(
|
|
1930
|
-
return
|
|
2046
|
+
function scanLeftWithIndex_1(initial, f) {
|
|
2047
|
+
return fa => {
|
|
2048
|
+
return tsplus_module_8.operate_(scanInternal(f, initial, true, true))(fa);
|
|
2049
|
+
};
|
|
1931
2050
|
}
|
|
1932
2051
|
/**
|
|
1933
|
-
* @tsplus
|
|
2052
|
+
* @tsplus pipeable fncts.observable.Observable scanLeft
|
|
1934
2053
|
*/
|
|
1935
2054
|
|
|
1936
2055
|
|
|
1937
|
-
function scanLeft(
|
|
1938
|
-
return
|
|
2056
|
+
function scanLeft(initial, f) {
|
|
2057
|
+
return fa => {
|
|
2058
|
+
return scanLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
2059
|
+
};
|
|
1939
2060
|
}
|
|
1940
2061
|
/**
|
|
1941
2062
|
* @tsplus static fncts.observable.ObservableOps service
|
|
@@ -1965,99 +2086,111 @@ tag) {
|
|
|
1965
2086
|
function serviceWithObservable_1(f,
|
|
1966
2087
|
/** @tsplus auto */
|
|
1967
2088
|
tag) {
|
|
1968
|
-
return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(
|
|
2089
|
+
return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(tag)(environment)));
|
|
1969
2090
|
}
|
|
1970
2091
|
/**
|
|
1971
|
-
* @tsplus
|
|
2092
|
+
* @tsplus pipeable fncts.observable.Observable skip
|
|
1972
2093
|
*/
|
|
1973
2094
|
|
|
1974
2095
|
|
|
1975
|
-
function
|
|
1976
|
-
return
|
|
2096
|
+
function skip(count) {
|
|
2097
|
+
return fa => {
|
|
2098
|
+
return filterWithIndex_1((index, _) => count <= index)(fa);
|
|
2099
|
+
};
|
|
1977
2100
|
}
|
|
1978
2101
|
/**
|
|
1979
|
-
* @tsplus
|
|
2102
|
+
* @tsplus pipeable fncts.observable.Observable skipLast
|
|
1980
2103
|
*/
|
|
1981
2104
|
|
|
1982
2105
|
|
|
1983
|
-
function
|
|
1984
|
-
return
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
2106
|
+
function skipLast(skipCount) {
|
|
2107
|
+
return fa => {
|
|
2108
|
+
return skipCount <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2109
|
+
let ring = new Array(skipCount);
|
|
2110
|
+
let seen = 0;
|
|
2111
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2112
|
+
next: value => {
|
|
2113
|
+
const valueIndex = seen++;
|
|
1990
2114
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2115
|
+
if (valueIndex < skipCount) {
|
|
2116
|
+
ring[valueIndex] = value;
|
|
2117
|
+
} else {
|
|
2118
|
+
const index = valueIndex % skipCount;
|
|
2119
|
+
const oldValue = ring[index];
|
|
2120
|
+
ring[index] = value;
|
|
2121
|
+
subscriber.next(oldValue);
|
|
2122
|
+
}
|
|
1998
2123
|
}
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
};
|
|
2004
|
-
}
|
|
2124
|
+
}));
|
|
2125
|
+
return () => {
|
|
2126
|
+
ring = null;
|
|
2127
|
+
};
|
|
2128
|
+
})(fa);
|
|
2129
|
+
};
|
|
2005
2130
|
}
|
|
2006
2131
|
/**
|
|
2007
|
-
* @tsplus
|
|
2132
|
+
* @tsplus pipeable fncts.observable.Observable skipUntil
|
|
2008
2133
|
*/
|
|
2009
2134
|
|
|
2010
2135
|
|
|
2011
|
-
function
|
|
2012
|
-
return
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2136
|
+
function skipUntil(notifier) {
|
|
2137
|
+
return fa => {
|
|
2138
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2139
|
+
let taking = false;
|
|
2140
|
+
const skipSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2141
|
+
next: () => {
|
|
2142
|
+
skipSubscriber?.unsubscribe();
|
|
2143
|
+
taking = true;
|
|
2144
|
+
},
|
|
2145
|
+
complete: tsplus_module_2.noop
|
|
2146
|
+
});
|
|
2147
|
+
from_1(notifier).provideEnvironment(environment).subscribe(skipSubscriber);
|
|
2148
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2149
|
+
next: value => taking && subscriber.next(value)
|
|
2150
|
+
}));
|
|
2151
|
+
})(fa);
|
|
2152
|
+
};
|
|
2026
2153
|
}
|
|
2027
2154
|
/**
|
|
2028
|
-
* @tsplus
|
|
2155
|
+
* @tsplus pipeable fncts.observable.Observable skipWhile
|
|
2029
2156
|
*/
|
|
2030
2157
|
|
|
2031
2158
|
|
|
2032
|
-
function
|
|
2033
|
-
return
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2159
|
+
function skipWhile(predicate) {
|
|
2160
|
+
return fa => {
|
|
2161
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2162
|
+
let taking = false;
|
|
2163
|
+
let index = 0;
|
|
2164
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2165
|
+
next: value => (taking || (taking = !predicate(index++, value))) && subscriber.next(value)
|
|
2166
|
+
}));
|
|
2167
|
+
})(fa);
|
|
2168
|
+
};
|
|
2040
2169
|
}
|
|
2041
2170
|
/**
|
|
2042
|
-
* @tsplus
|
|
2171
|
+
* @tsplus pipeable fncts.observable.Observable startWith
|
|
2043
2172
|
*/
|
|
2044
2173
|
|
|
2045
2174
|
|
|
2046
|
-
function
|
|
2047
|
-
return
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2175
|
+
function startWith(...values) {
|
|
2176
|
+
return fa => {
|
|
2177
|
+
return tsplus_module_8.operate_((source, subscriber) => {
|
|
2178
|
+
// @ts-expect-error
|
|
2179
|
+
concat_1(values)(source).subscribe(subscriber);
|
|
2180
|
+
})(fa);
|
|
2181
|
+
};
|
|
2051
2182
|
}
|
|
2052
2183
|
/**
|
|
2053
|
-
* @tsplus
|
|
2184
|
+
* @tsplus pipeable fncts.observable.Observable subscribeOn
|
|
2054
2185
|
*/
|
|
2055
2186
|
|
|
2056
2187
|
|
|
2057
|
-
function
|
|
2058
|
-
return
|
|
2059
|
-
|
|
2060
|
-
|
|
2188
|
+
function subscribeOn(scheduler, delay = 0) {
|
|
2189
|
+
return fa => {
|
|
2190
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2191
|
+
subscriber.add(scheduler.schedule(() => source.provideEnvironment(environment).subscribe(subscriber), delay));
|
|
2192
|
+
})(fa);
|
|
2193
|
+
};
|
|
2061
2194
|
}
|
|
2062
2195
|
/**
|
|
2063
2196
|
* @tsplus getter fncts.observable.Observable switchAll
|
|
@@ -2065,168 +2198,188 @@ function subscribeOn_(fa, scheduler, delay = 0) {
|
|
|
2065
2198
|
|
|
2066
2199
|
|
|
2067
2200
|
function switchAll(ffa) {
|
|
2068
|
-
return switchMap_1(
|
|
2201
|
+
return switchMap_1(tsplus_module_13.identity)(ffa);
|
|
2069
2202
|
}
|
|
2070
2203
|
/**
|
|
2071
|
-
* @tsplus
|
|
2204
|
+
* @tsplus pipeable fncts.observable.Observable switchMapWithIndex
|
|
2072
2205
|
*/
|
|
2073
2206
|
|
|
2074
2207
|
|
|
2075
|
-
function switchMapWithIndex_1(
|
|
2076
|
-
return
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2208
|
+
function switchMapWithIndex_1(f) {
|
|
2209
|
+
return fa => {
|
|
2210
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2211
|
+
let innerSubscriber = null;
|
|
2212
|
+
let index = 0;
|
|
2213
|
+
let isComplete = false;
|
|
2080
2214
|
|
|
2081
|
-
|
|
2215
|
+
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
|
|
2082
2216
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2217
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2218
|
+
next: value => {
|
|
2219
|
+
innerSubscriber?.unsubscribe();
|
|
2220
|
+
const outerIndex = index++;
|
|
2221
|
+
from_1(f(outerIndex, value)).provideEnvironment(environment).subscribe(innerSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2222
|
+
next: innerValue => subscriber.next(innerValue),
|
|
2223
|
+
complete: () => {
|
|
2224
|
+
innerSubscriber = null;
|
|
2225
|
+
checkComplete();
|
|
2226
|
+
}
|
|
2227
|
+
}));
|
|
2228
|
+
}
|
|
2229
|
+
}, () => {
|
|
2230
|
+
isComplete = true;
|
|
2231
|
+
checkComplete();
|
|
2232
|
+
}));
|
|
2233
|
+
})(fa);
|
|
2234
|
+
};
|
|
2100
2235
|
}
|
|
2101
2236
|
/**
|
|
2102
|
-
* @tsplus
|
|
2237
|
+
* @tsplus pipeable fncts.observable.Observable switchMap
|
|
2103
2238
|
*/
|
|
2104
2239
|
|
|
2105
2240
|
|
|
2106
|
-
function switchMap_1(
|
|
2107
|
-
return
|
|
2241
|
+
function switchMap_1(f) {
|
|
2242
|
+
return fa => {
|
|
2243
|
+
return switchMapWithIndex_1((_, a) => f(a))(fa);
|
|
2244
|
+
};
|
|
2108
2245
|
}
|
|
2109
2246
|
/**
|
|
2110
|
-
* @tsplus
|
|
2247
|
+
* @tsplus pipeable fncts.observable.Observable switchScanWithIndex
|
|
2111
2248
|
*/
|
|
2112
2249
|
|
|
2113
2250
|
|
|
2114
|
-
function switchScanWithIndex_1(
|
|
2115
|
-
return
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2251
|
+
function switchScanWithIndex_1(initial, f) {
|
|
2252
|
+
return fa => {
|
|
2253
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2254
|
+
let state = initial;
|
|
2255
|
+
switchMapWithIndex_1((index, value) => map_1(b => (state = b, b))(from_1(f(index, state, value))))(source).provideEnvironment(environment).subscribe(subscriber);
|
|
2256
|
+
return () => {
|
|
2257
|
+
state = null;
|
|
2258
|
+
};
|
|
2259
|
+
})(fa);
|
|
2260
|
+
};
|
|
2122
2261
|
}
|
|
2123
2262
|
/**
|
|
2124
|
-
* @tsplus
|
|
2263
|
+
* @tsplus pipeable fncts.observable.Observable switchScan
|
|
2125
2264
|
*/
|
|
2126
2265
|
|
|
2127
2266
|
|
|
2128
|
-
function
|
|
2129
|
-
return
|
|
2267
|
+
function switchScan(initial, f) {
|
|
2268
|
+
return fa => {
|
|
2269
|
+
return switchScanWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
|
|
2270
|
+
};
|
|
2130
2271
|
}
|
|
2131
2272
|
/**
|
|
2132
|
-
* @tsplus
|
|
2273
|
+
* @tsplus pipeable fncts.observable.Observable take
|
|
2133
2274
|
*/
|
|
2134
2275
|
|
|
2135
2276
|
|
|
2136
|
-
function take_1(
|
|
2137
|
-
return
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2277
|
+
function take_1(count) {
|
|
2278
|
+
return fa => {
|
|
2279
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, sub, environment) => {
|
|
2280
|
+
let seen = 0;
|
|
2281
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(sub, {
|
|
2282
|
+
next: value => {
|
|
2283
|
+
if (++seen <= count) {
|
|
2284
|
+
sub.next(value);
|
|
2143
2285
|
|
|
2144
|
-
|
|
2145
|
-
|
|
2286
|
+
if (count <= seen) {
|
|
2287
|
+
sub.complete();
|
|
2288
|
+
}
|
|
2146
2289
|
}
|
|
2147
2290
|
}
|
|
2148
|
-
}
|
|
2149
|
-
}));
|
|
2150
|
-
}
|
|
2291
|
+
}));
|
|
2292
|
+
})(fa);
|
|
2293
|
+
};
|
|
2151
2294
|
}
|
|
2152
2295
|
/**
|
|
2153
|
-
* @tsplus
|
|
2296
|
+
* @tsplus pipeable fncts.observable.Observable takeLast
|
|
2154
2297
|
*/
|
|
2155
2298
|
|
|
2156
2299
|
|
|
2157
|
-
function
|
|
2158
|
-
return
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2300
|
+
function takeLast(count) {
|
|
2301
|
+
return fa => {
|
|
2302
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2303
|
+
let buffer = [];
|
|
2304
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2305
|
+
next: value => {
|
|
2306
|
+
buffer.push(value);
|
|
2307
|
+
count < buffer.length && buffer.shift();
|
|
2308
|
+
},
|
|
2309
|
+
complete: () => {
|
|
2310
|
+
for (const value of buffer) {
|
|
2311
|
+
subscriber.next(value);
|
|
2312
|
+
}
|
|
2169
2313
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2314
|
+
subscriber.complete();
|
|
2315
|
+
}
|
|
2316
|
+
}, () => {
|
|
2317
|
+
buffer = null;
|
|
2318
|
+
}));
|
|
2319
|
+
})(fa);
|
|
2320
|
+
};
|
|
2176
2321
|
}
|
|
2177
2322
|
/**
|
|
2178
|
-
* @tsplus
|
|
2323
|
+
* @tsplus pipeable fncts.observable.Observable takeUntil
|
|
2179
2324
|
*/
|
|
2180
2325
|
|
|
2181
2326
|
|
|
2182
|
-
function
|
|
2183
|
-
return
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2327
|
+
function takeUntil(notifier) {
|
|
2328
|
+
return fa => {
|
|
2329
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2330
|
+
from_1(notifier).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2331
|
+
next: () => subscriber.complete(),
|
|
2332
|
+
complete: tsplus_module_2.noop
|
|
2333
|
+
}));
|
|
2334
|
+
!subscriber.closed && source.provideEnvironment(environment).subscribe(subscriber);
|
|
2335
|
+
})(fa);
|
|
2336
|
+
};
|
|
2190
2337
|
}
|
|
2191
2338
|
|
|
2192
|
-
function takeWhileWithIndex_1(
|
|
2193
|
-
return
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2339
|
+
function takeWhileWithIndex_1(predicate, inclusive) {
|
|
2340
|
+
return fa => {
|
|
2341
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2342
|
+
let index = 0;
|
|
2343
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2344
|
+
next: value => {
|
|
2345
|
+
const result = predicate(index++, value);
|
|
2346
|
+
(result || inclusive) && subscriber.next(value);
|
|
2347
|
+
!result && subscriber.complete();
|
|
2348
|
+
}
|
|
2349
|
+
}));
|
|
2350
|
+
})(fa);
|
|
2351
|
+
};
|
|
2203
2352
|
}
|
|
2204
2353
|
|
|
2205
|
-
function
|
|
2206
|
-
return
|
|
2354
|
+
function takeWhile(predicate, inclusive) {
|
|
2355
|
+
return fa => {
|
|
2356
|
+
return takeWhileWithIndex_1((_, a) => predicate(a), inclusive)(fa);
|
|
2357
|
+
};
|
|
2207
2358
|
}
|
|
2208
2359
|
/**
|
|
2209
|
-
* @tsplus
|
|
2360
|
+
* @tsplus pipeable fncts.observable.Observable tap
|
|
2210
2361
|
*/
|
|
2211
2362
|
|
|
2212
2363
|
|
|
2213
|
-
function
|
|
2214
|
-
return
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2364
|
+
function tap(observer) {
|
|
2365
|
+
return fa => {
|
|
2366
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2367
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2368
|
+
next: value => {
|
|
2369
|
+
observer.next?.(value);
|
|
2370
|
+
subscriber.next(value);
|
|
2371
|
+
},
|
|
2372
|
+
error: err => {
|
|
2373
|
+
observer.error?.(err);
|
|
2374
|
+
subscriber.error(err);
|
|
2375
|
+
},
|
|
2376
|
+
complete: () => {
|
|
2377
|
+
observer.complete?.();
|
|
2378
|
+
subscriber.complete();
|
|
2379
|
+
}
|
|
2380
|
+
}));
|
|
2381
|
+
})(fa);
|
|
2382
|
+
};
|
|
2230
2383
|
}
|
|
2231
2384
|
|
|
2232
2385
|
const defaultThrottleConfig = {
|
|
@@ -2234,71 +2387,75 @@ const defaultThrottleConfig = {
|
|
|
2234
2387
|
trailing: false
|
|
2235
2388
|
};
|
|
2236
2389
|
/**
|
|
2237
|
-
* @tsplus
|
|
2390
|
+
* @tsplus pipeable fncts.observable.Observable throttle
|
|
2238
2391
|
*/
|
|
2239
2392
|
|
|
2240
2393
|
exports.defaultThrottleConfig = defaultThrottleConfig;
|
|
2241
2394
|
|
|
2242
|
-
function throttle_1(
|
|
2395
|
+
function throttle_1(durationSelector, {
|
|
2243
2396
|
leading,
|
|
2244
2397
|
trailing
|
|
2245
2398
|
} = defaultThrottleConfig) {
|
|
2246
|
-
return
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2399
|
+
return fa => {
|
|
2400
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2401
|
+
let sendValue = tsplus_module_17.nothing();
|
|
2402
|
+
let throttled = null;
|
|
2403
|
+
let isComplete = false;
|
|
2404
|
+
|
|
2405
|
+
const endThrottling = () => {
|
|
2406
|
+
throttled?.unsubscribe();
|
|
2407
|
+
throttled = null;
|
|
2408
|
+
|
|
2409
|
+
if (trailing) {
|
|
2410
|
+
send();
|
|
2411
|
+
isComplete && subscriber.complete();
|
|
2412
|
+
}
|
|
2413
|
+
};
|
|
2254
2414
|
|
|
2255
|
-
|
|
2256
|
-
|
|
2415
|
+
const cleanupThrottling = () => {
|
|
2416
|
+
throttled = null;
|
|
2257
2417
|
isComplete && subscriber.complete();
|
|
2258
|
-
}
|
|
2259
|
-
};
|
|
2260
|
-
|
|
2261
|
-
const cleanupThrottling = () => {
|
|
2262
|
-
throttled = null;
|
|
2263
|
-
isComplete && subscriber.complete();
|
|
2264
|
-
};
|
|
2418
|
+
};
|
|
2265
2419
|
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2420
|
+
const startThrottling = value => throttled = from_1(durationSelector(value)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2421
|
+
next: endThrottling,
|
|
2422
|
+
complete: cleanupThrottling
|
|
2423
|
+
}));
|
|
2270
2424
|
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2425
|
+
const send = () => {
|
|
2426
|
+
if (tsplus_module_18.isJust(sendValue)) {
|
|
2427
|
+
const {
|
|
2428
|
+
value
|
|
2429
|
+
} = sendValue;
|
|
2430
|
+
sendValue = tsplus_module_17.nothing();
|
|
2431
|
+
subscriber.next(value);
|
|
2432
|
+
!isComplete && startThrottling(value);
|
|
2433
|
+
}
|
|
2434
|
+
};
|
|
2281
2435
|
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2436
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2437
|
+
next: value => {
|
|
2438
|
+
sendValue = tsplus_module_17.just(value);
|
|
2439
|
+
!(throttled && !throttled.closed) && (leading ? send() : startThrottling(value));
|
|
2440
|
+
},
|
|
2441
|
+
complete: () => {
|
|
2442
|
+
isComplete = true;
|
|
2443
|
+
!(trailing && tsplus_module_18.isJust(sendValue) && throttled && !throttled.closed) && subscriber.complete();
|
|
2444
|
+
}
|
|
2445
|
+
}));
|
|
2446
|
+
})(fa);
|
|
2447
|
+
};
|
|
2293
2448
|
}
|
|
2294
2449
|
/**
|
|
2295
|
-
* @tsplus
|
|
2450
|
+
* @tsplus pipeable fncts.observable.Observable throttleTime
|
|
2296
2451
|
*/
|
|
2297
2452
|
|
|
2298
2453
|
|
|
2299
|
-
function
|
|
2300
|
-
|
|
2301
|
-
|
|
2454
|
+
function throttleTime(duration, scheduler = tsplus_module_5.asyncScheduler, config = defaultThrottleConfig) {
|
|
2455
|
+
return fa => {
|
|
2456
|
+
const duration$ = timer_1(duration, scheduler);
|
|
2457
|
+
return throttle_1(() => duration$, config)(fa);
|
|
2458
|
+
};
|
|
2302
2459
|
}
|
|
2303
2460
|
|
|
2304
2461
|
class TimeoutError extends Error {
|
|
@@ -2312,49 +2469,51 @@ class TimeoutError extends Error {
|
|
|
2312
2469
|
|
|
2313
2470
|
exports.TimeoutError = TimeoutError;
|
|
2314
2471
|
|
|
2315
|
-
function
|
|
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
|
-
timerSubscription?.
|
|
2352
|
-
|
|
2472
|
+
function timeout(config) {
|
|
2473
|
+
return fa => {
|
|
2474
|
+
const {
|
|
2475
|
+
first,
|
|
2476
|
+
each,
|
|
2477
|
+
with: _with = timeoutError,
|
|
2478
|
+
scheduler = tsplus_module_5.asyncScheduler,
|
|
2479
|
+
meta = null
|
|
2480
|
+
} = config;
|
|
2481
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2482
|
+
// eslint-disable-next-line prefer-const
|
|
2483
|
+
let originalSourceSubscription;
|
|
2484
|
+
let timerSubscription;
|
|
2485
|
+
let lastValue = tsplus_module_17.nothing();
|
|
2486
|
+
let seen = 0;
|
|
2487
|
+
|
|
2488
|
+
const startTimer = delay => {
|
|
2489
|
+
timerSubscription = (0, tsplus_module_7.caughtSchedule)(subscriber, scheduler, () => {
|
|
2490
|
+
originalSourceSubscription.unsubscribe();
|
|
2491
|
+
from_1(_with({
|
|
2492
|
+
meta,
|
|
2493
|
+
lastValue,
|
|
2494
|
+
seen
|
|
2495
|
+
})).provideEnvironment(environment).subscribe(subscriber);
|
|
2496
|
+
}, delay);
|
|
2497
|
+
};
|
|
2498
|
+
|
|
2499
|
+
originalSourceSubscription = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2500
|
+
next: value => {
|
|
2501
|
+
timerSubscription?.unsubscribe();
|
|
2502
|
+
seen++;
|
|
2503
|
+
lastValue = tsplus_module_17.just(value);
|
|
2504
|
+
subscriber.next(value);
|
|
2505
|
+
each > 0 && startTimer(each);
|
|
2506
|
+
}
|
|
2507
|
+
}, () => {
|
|
2508
|
+
if (!timerSubscription?.closed) {
|
|
2509
|
+
timerSubscription?.unsubscribe();
|
|
2510
|
+
}
|
|
2353
2511
|
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2512
|
+
lastValue = tsplus_module_17.nothing();
|
|
2513
|
+
}));
|
|
2514
|
+
startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
|
|
2515
|
+
})(fa);
|
|
2516
|
+
};
|
|
2358
2517
|
}
|
|
2359
2518
|
|
|
2360
2519
|
function timeoutError(info) {
|
|
@@ -2370,60 +2529,66 @@ function toArrayAccumulator(arr, value) {
|
|
|
2370
2529
|
|
|
2371
2530
|
|
|
2372
2531
|
function toArray_1(fa) {
|
|
2373
|
-
return tsplus_module_8.operate_(
|
|
2374
|
-
foldLeft_1(
|
|
2375
|
-
});
|
|
2532
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2533
|
+
foldLeft_1([], toArrayAccumulator)(source).provideEnvironment(environment).subscribe(subscriber);
|
|
2534
|
+
})(fa);
|
|
2376
2535
|
}
|
|
2377
2536
|
/**
|
|
2378
|
-
* @tsplus
|
|
2537
|
+
* @tsplus pipeable fncts.observable.Observable unique
|
|
2379
2538
|
*/
|
|
2380
2539
|
|
|
2381
2540
|
|
|
2382
|
-
function
|
|
2383
|
-
return
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2541
|
+
function unique(toKey, flushes) {
|
|
2542
|
+
return fa => {
|
|
2543
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2544
|
+
let distinctKeys = tsplus_module_21.makeDefault();
|
|
2545
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2546
|
+
next: value => {
|
|
2547
|
+
const key = toKey ? toKey(value) : value;
|
|
2388
2548
|
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2549
|
+
if (!tsplus_module_21.has(key)(distinctKeys)) {
|
|
2550
|
+
tsplus_module_21.add(key)(distinctKeys);
|
|
2551
|
+
subscriber.next(value);
|
|
2552
|
+
}
|
|
2392
2553
|
}
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
}));
|
|
2399
|
-
}
|
|
2554
|
+
}));
|
|
2555
|
+
flushes?.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2556
|
+
next: () => distinctKeys = tsplus_module_21.makeDefault(),
|
|
2557
|
+
complete: tsplus_module_2.noop
|
|
2558
|
+
}));
|
|
2559
|
+
})(fa);
|
|
2560
|
+
};
|
|
2400
2561
|
}
|
|
2401
2562
|
|
|
2402
|
-
function uniqueUntilChanged_1(
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2563
|
+
function uniqueUntilChanged_1(E, keySelector = tsplus_module_13.identity) {
|
|
2564
|
+
return fa => {
|
|
2565
|
+
const compare = "equals" in E ? E.equals : E;
|
|
2566
|
+
return tsplus_module_8.operate_((source, subscriber, environment) => {
|
|
2567
|
+
let previousKey;
|
|
2568
|
+
let first = true;
|
|
2569
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2570
|
+
next: value => {
|
|
2571
|
+
const currentKey = keySelector(value);
|
|
2410
2572
|
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2573
|
+
if (first || !compare(previousKey, currentKey)) {
|
|
2574
|
+
first = false;
|
|
2575
|
+
previousKey = currentKey;
|
|
2576
|
+
subscriber.next(value);
|
|
2577
|
+
}
|
|
2415
2578
|
}
|
|
2416
|
-
}
|
|
2417
|
-
}));
|
|
2418
|
-
}
|
|
2579
|
+
}));
|
|
2580
|
+
})(fa);
|
|
2581
|
+
};
|
|
2419
2582
|
}
|
|
2420
2583
|
|
|
2421
|
-
function
|
|
2422
|
-
|
|
2423
|
-
|
|
2584
|
+
function uniqueUntilKeyChanged(key, equals) {
|
|
2585
|
+
return fa => {
|
|
2586
|
+
const compare = "equals" in equals ? equals.equals : equals;
|
|
2587
|
+
return uniqueUntilChanged_1((x, y) => compare(x[key], y[key]))(fa);
|
|
2588
|
+
};
|
|
2424
2589
|
}
|
|
2425
2590
|
|
|
2426
|
-
function combineLatestInternal(subscriber, observables, scheduler, valueTransform = tsplus_module_13.identity) {
|
|
2591
|
+
function combineLatestInternal(subscriber, environment, observables, scheduler, valueTransform = tsplus_module_13.identity) {
|
|
2427
2592
|
return maybeSchedule(subscriber, scheduler, () => {
|
|
2428
2593
|
const {
|
|
2429
2594
|
length
|
|
@@ -2434,9 +2599,9 @@ function combineLatestInternal(subscriber, observables, scheduler, valueTransfor
|
|
|
2434
2599
|
|
|
2435
2600
|
for (let i = 0; i < length; i++) {
|
|
2436
2601
|
maybeSchedule(subscriber, scheduler, () => {
|
|
2437
|
-
const source = scheduler ? scheduled_1(observables[i]
|
|
2602
|
+
const source = scheduler ? scheduled_1(scheduler)(observables[i]) : from_1(observables[i]);
|
|
2438
2603
|
let hasFirstValue = false;
|
|
2439
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2604
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2440
2605
|
next: value => {
|
|
2441
2606
|
values[i] = value;
|
|
2442
2607
|
|
|
@@ -2462,9 +2627,9 @@ function combineLatestInternal(subscriber, observables, scheduler, valueTransfor
|
|
|
2462
2627
|
|
|
2463
2628
|
function findInternal(predicate, emit) {
|
|
2464
2629
|
const findIndex = emit === "index";
|
|
2465
|
-
return (source, subscriber) => {
|
|
2630
|
+
return (source, subscriber, environment) => {
|
|
2466
2631
|
let index = 0;
|
|
2467
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2632
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2468
2633
|
next: value => {
|
|
2469
2634
|
const i = index++;
|
|
2470
2635
|
|
|
@@ -2482,7 +2647,7 @@ function findInternal(predicate, emit) {
|
|
|
2482
2647
|
}
|
|
2483
2648
|
|
|
2484
2649
|
function joinAllInternal(fa, joiner) {
|
|
2485
|
-
return mergeMap_1(toArray_1(fa)
|
|
2650
|
+
return mergeMap_1(joiner)(toArray_1(fa));
|
|
2486
2651
|
}
|
|
2487
2652
|
|
|
2488
2653
|
function maybeSchedule(subscription, scheduler, execute) {
|
|
@@ -2493,7 +2658,7 @@ function maybeSchedule(subscription, scheduler, execute) {
|
|
|
2493
2658
|
}
|
|
2494
2659
|
}
|
|
2495
2660
|
|
|
2496
|
-
function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
|
|
2661
|
+
function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
|
|
2497
2662
|
const buffer = [];
|
|
2498
2663
|
let active = 0;
|
|
2499
2664
|
let index = 0;
|
|
@@ -2511,7 +2676,7 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2511
2676
|
expand && subscriber.next(a);
|
|
2512
2677
|
active++;
|
|
2513
2678
|
let innerComplete = false;
|
|
2514
|
-
from_1(f(index++, a)).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2679
|
+
from_1(f(index++, a)).provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2515
2680
|
next: b => {
|
|
2516
2681
|
onBeforeNext?.(b);
|
|
2517
2682
|
|
|
@@ -2542,7 +2707,7 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2542
2707
|
}));
|
|
2543
2708
|
};
|
|
2544
2709
|
|
|
2545
|
-
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2710
|
+
source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2546
2711
|
next: outerNext,
|
|
2547
2712
|
complete: () => {
|
|
2548
2713
|
isComplete = true;
|
|
@@ -2555,11 +2720,11 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2555
2720
|
}
|
|
2556
2721
|
|
|
2557
2722
|
function scanInternal(f, initial, hasInitial, emitOnNext, emitBeforeComplete) {
|
|
2558
|
-
return (source, subscriber) => {
|
|
2723
|
+
return (source, subscriber, environment) => {
|
|
2559
2724
|
let hasState = hasInitial;
|
|
2560
2725
|
let state = initial;
|
|
2561
2726
|
let index = 0;
|
|
2562
|
-
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2727
|
+
source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2563
2728
|
next: value => {
|
|
2564
2729
|
const i = index++;
|
|
2565
2730
|
state = hasState ? f(i, state, value) : (hasState = true, value);
|