@fncts/observable 0.0.2 → 0.0.3
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 +1 -1
- package/Notification.d.ts +1 -1
- package/Observable/api/connect.d.ts +1 -1
- package/Observable/api/connectable.d.ts +5 -5
- package/Observable/api/fromCallback.d.ts +2 -2
- package/Observable/api/fromEvent.d.ts +1 -1
- package/Observable/api/race.d.ts +2 -2
- package/Observable/api/raceWith.d.ts +1 -1
- package/Observable/api/repeatWhen.d.ts +2 -2
- package/Observable/api/retryWhen.d.ts +3 -3
- package/Observable/api/share.d.ts +5 -6
- package/Observable/api/window.d.ts +2 -2
- package/Observable/api/windowCount.d.ts +1 -1
- package/Observable/api/windowTime.d.ts +3 -3
- package/Observable/api/windowToggle.d.ts +2 -2
- package/Observable/api/windowWhen.d.ts +2 -2
- package/Observable/api.d.ts +204 -163
- package/Observable/definition.d.ts +24 -15
- package/Observable/dom/animationFrames.d.ts +1 -1
- package/Observer.d.ts +1 -1
- package/Operator.d.ts +4 -3
- package/Subject.d.ts +10 -9
- package/Subscriber.d.ts +1 -1
- package/_cjs/BehaviorSubject.cjs.map +1 -1
- package/_cjs/Observable/api/connect.cjs.map +1 -1
- package/_cjs/Observable/api/connectable.cjs.map +1 -1
- package/_cjs/Observable/api/fromCallback.cjs.map +1 -1
- package/_cjs/Observable/api/race.cjs.map +1 -1
- package/_cjs/Observable/api/raceWith.cjs.map +1 -1
- package/_cjs/Observable/api/repeatWhen.cjs.map +1 -1
- package/_cjs/Observable/api/retryWhen.cjs.map +1 -1
- package/_cjs/Observable/api/share.cjs +2 -11
- package/_cjs/Observable/api/share.cjs.map +1 -1
- package/_cjs/Observable/api/window.cjs.map +1 -1
- package/_cjs/Observable/api/windowTime.cjs.map +1 -1
- package/_cjs/Observable/api/windowToggle.cjs.map +1 -1
- package/_cjs/Observable/api/windowWhen.cjs.map +1 -1
- package/_cjs/Observable/api.cjs +325 -308
- package/_cjs/Observable/api.cjs.map +1 -1
- package/_cjs/Observable/definition.cjs +41 -15
- package/_cjs/Observable/definition.cjs.map +1 -1
- package/_cjs/Operator.cjs.map +1 -1
- package/_cjs/Subject.cjs +2 -2
- package/_cjs/Subject.cjs.map +1 -1
- package/_cjs/global.cjs +3 -1
- package/_cjs/global.cjs.map +1 -1
- package/_mjs/BehaviorSubject.mjs.map +1 -1
- package/_mjs/Observable/api/connect.mjs.map +1 -1
- package/_mjs/Observable/api/connectable.mjs.map +1 -1
- package/_mjs/Observable/api/fromCallback.mjs.map +1 -1
- package/_mjs/Observable/api/race.mjs.map +1 -1
- package/_mjs/Observable/api/raceWith.mjs.map +1 -1
- package/_mjs/Observable/api/repeatWhen.mjs.map +1 -1
- package/_mjs/Observable/api/retryWhen.mjs.map +1 -1
- package/_mjs/Observable/api/share.mjs +1 -6
- package/_mjs/Observable/api/share.mjs.map +1 -1
- package/_mjs/Observable/api/window.mjs.map +1 -1
- package/_mjs/Observable/api/windowTime.mjs.map +1 -1
- package/_mjs/Observable/api/windowToggle.mjs.map +1 -1
- package/_mjs/Observable/api/windowWhen.mjs.map +1 -1
- package/_mjs/Observable/api.mjs +301 -293
- package/_mjs/Observable/api.mjs.map +1 -1
- package/_mjs/Observable/definition.mjs +36 -14
- package/_mjs/Observable/definition.mjs.map +1 -1
- package/_mjs/Operator.mjs.map +1 -1
- package/_mjs/Subject.mjs +2 -2
- package/_mjs/Subject.mjs.map +1 -1
- package/_mjs/global.mjs +1 -1
- package/_mjs/global.mjs.map +1 -1
- package/_src/BehaviorSubject.ts +1 -1
- package/_src/Observable/api/connect.ts +5 -5
- package/_src/Observable/api/connectable.ts +7 -7
- package/_src/Observable/api/fromCallback.ts +8 -5
- package/_src/Observable/api/fromEvent.ts +1 -1
- package/_src/Observable/api/race.ts +2 -2
- package/_src/Observable/api/raceWith.ts +7 -3
- package/_src/Observable/api/repeatWhen.ts +8 -8
- package/_src/Observable/api/retryWhen.ts +8 -8
- package/_src/Observable/api/share.ts +10 -16
- package/_src/Observable/api/window.ts +5 -5
- package/_src/Observable/api/windowCount.ts +5 -5
- package/_src/Observable/api/windowTime.ts +18 -18
- package/_src/Observable/api/windowToggle.ts +8 -8
- package/_src/Observable/api/windowWhen.ts +6 -6
- package/_src/Observable/api.ts +524 -429
- package/_src/Observable/definition.ts +45 -21
- package/_src/Observable/dom/animationFrames.ts +2 -2
- package/_src/Operator.ts +6 -6
- package/_src/Subject.ts +9 -9
- package/_src/global.ts +5 -46
- package/global.d.ts +5 -45
- package/package.json +2 -2
package/_mjs/Observable/api.mjs
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
const fileName_1 = "(@fncts/observable) src/Observable/api.ts";
|
|
2
|
-
import * as tsplus_module_1 from "@fncts/
|
|
3
|
-
import * as tsplus_module_2 from "@fncts/
|
|
4
|
-
import * as tsplus_module_3 from "@fncts/
|
|
5
|
-
import * as tsplus_module_4 from "@fncts/
|
|
6
|
-
import * as tsplus_module_5 from "@fncts/
|
|
7
|
-
import * as tsplus_module_6 from "@fncts/observable/
|
|
8
|
-
import * as tsplus_module_7 from "@fncts/observable/
|
|
9
|
-
import * as tsplus_module_8 from "@fncts/observable/
|
|
10
|
-
import * as tsplus_module_9 from "@fncts/
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/base/data/Cause/api";
|
|
3
|
+
import * as tsplus_module_2 from "@fncts/observable/internal/util";
|
|
4
|
+
import * as tsplus_module_3 from "@fncts/base/util/predicates";
|
|
5
|
+
import * as tsplus_module_4 from "@fncts/io/IO";
|
|
6
|
+
import * as tsplus_module_5 from "@fncts/observable/AsyncScheduler";
|
|
7
|
+
import * as tsplus_module_6 from "@fncts/observable/Subscription";
|
|
8
|
+
import * as tsplus_module_7 from "@fncts/observable/Scheduler";
|
|
9
|
+
import * as tsplus_module_8 from "@fncts/observable/Operator";
|
|
10
|
+
import * as tsplus_module_9 from "@fncts/io/IO/api/environment";
|
|
11
11
|
import * as tsplus_module_10 from "@fncts/io/IO/runtime";
|
|
12
12
|
import * as tsplus_module_11 from "@fncts/base/data/Exit/api";
|
|
13
13
|
import * as tsplus_module_12 from "@fncts/io/Fiber/api/interrupt";
|
|
14
14
|
import * as tsplus_module_13 from "@fncts/base/data/function/api";
|
|
15
15
|
import * as tsplus_module_14 from "@fncts/base/data/Either/destructors";
|
|
16
16
|
import * as tsplus_module_15 from "@fncts/base/data/Maybe/destructors";
|
|
17
|
-
import * as tsplus_module_16 from "@fncts/base/data/
|
|
18
|
-
import * as tsplus_module_17 from "@fncts/base/data/Maybe/
|
|
19
|
-
import * as tsplus_module_18 from "@fncts/base/data/
|
|
20
|
-
import * as tsplus_module_19 from "@fncts/
|
|
21
|
-
import * as tsplus_module_20 from "@fncts/
|
|
17
|
+
import * as tsplus_module_16 from "@fncts/base/data/Environment/api";
|
|
18
|
+
import * as tsplus_module_17 from "@fncts/base/data/Maybe/constructors";
|
|
19
|
+
import * as tsplus_module_18 from "@fncts/base/data/Maybe/definition";
|
|
20
|
+
import * as tsplus_module_19 from "@fncts/base/data/Either/constructors";
|
|
21
|
+
import * as tsplus_module_20 from "@fncts/observable/Notification";
|
|
22
|
+
import * as tsplus_module_21 from "@fncts/base/collection/immutable/HashSet/api";
|
|
22
23
|
export const defer = defer_1;
|
|
23
24
|
export const empty = empty_1;
|
|
25
|
+
export const environmentWithObservable = environmentWithObservable_1;
|
|
24
26
|
export const fail = fail_1;
|
|
25
27
|
export const from = from_1;
|
|
26
28
|
export const fromSubscribable = fromSubscribable_1;
|
|
27
29
|
export const interval = interval_1;
|
|
30
|
+
export const of = of_1;
|
|
28
31
|
export const single = single_1;
|
|
29
32
|
export const scheduled = scheduled_1;
|
|
30
33
|
export const timer = timer_1;
|
|
@@ -39,10 +42,10 @@ export const partitionWithIndex = partitionWithIndex_1;
|
|
|
39
42
|
export const partitionMapWithIndex_ = partitionMapWithIndex_1;
|
|
40
43
|
export const mergeMapWithIndex = mergeMapWithIndex_1;
|
|
41
44
|
export const mergeMap_ = mergeMap_1;
|
|
45
|
+
export const contramapEnvironment = contramapEnvironment_1;
|
|
42
46
|
export const foldLeftWithIndex = foldLeftWithIndex_1;
|
|
43
47
|
export const foldLeft = foldLeft_1;
|
|
44
48
|
export const audit_ = audit_1;
|
|
45
|
-
export const bufferWhen_ = bufferWhen_1;
|
|
46
49
|
export const catchAllCause = catchAllCause_1;
|
|
47
50
|
export const concatAll = concatAll_1;
|
|
48
51
|
export const concat_ = concat_1;
|
|
@@ -59,6 +62,7 @@ export const mergeScanWithIndex = mergeScanWithIndex_1;
|
|
|
59
62
|
export const onEmpty_ = onEmpty_1;
|
|
60
63
|
export const sample_ = sample_1;
|
|
61
64
|
export const scanLeftWithIndex = scanLeftWithIndex_1;
|
|
65
|
+
export const serviceWithObservable = serviceWithObservable_1;
|
|
62
66
|
export const switchMapWithIndex = switchMapWithIndex_1;
|
|
63
67
|
export const switchMap_ = switchMap_1;
|
|
64
68
|
export const switchScanWithIndex = switchScanWithIndex_1;
|
|
@@ -69,27 +73,21 @@ export const toArray = toArray_1;
|
|
|
69
73
|
export const uniqueUntilChanged_ = uniqueUntilChanged_1;
|
|
70
74
|
import { popNumber } from "@fncts/observable/internal/args";
|
|
71
75
|
import { arrayOrObject, arrayRemove, readableStreamToAsyncGenerator } from "@fncts/observable/internal/util";
|
|
72
|
-
import { EMPTY } from "@fncts/observable/Observable/definition";
|
|
76
|
+
import { EMPTY, EnvironmentWith, Observable } from "@fncts/observable/Observable/definition";
|
|
73
77
|
import { caughtSchedule } from "@fncts/observable/Scheduler";
|
|
74
|
-
/*
|
|
75
|
-
* -------------------------------------------------------------------------------------------------
|
|
76
|
-
* constructors
|
|
77
|
-
* -------------------------------------------------------------------------------------------------
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
78
|
/**
|
|
81
79
|
* @tsplus static fncts.observable.ObservableOps halt
|
|
82
80
|
*/
|
|
83
81
|
|
|
84
82
|
export function halt(defect) {
|
|
85
|
-
return new
|
|
83
|
+
return new Observable(s => s.error(tsplus_module_1.halt(defect)));
|
|
86
84
|
}
|
|
87
85
|
/**
|
|
88
86
|
* @tsplus static fncts.observable.ObservableOps defer
|
|
89
87
|
*/
|
|
90
88
|
|
|
91
89
|
function defer_1(observable) {
|
|
92
|
-
return new
|
|
90
|
+
return new Observable(s => {
|
|
93
91
|
from_1(observable()).subscribe(s);
|
|
94
92
|
});
|
|
95
93
|
}
|
|
@@ -101,20 +99,28 @@ function defer_1(observable) {
|
|
|
101
99
|
function empty_1() {
|
|
102
100
|
return EMPTY;
|
|
103
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* @tsplus static fncts.observable.ObservableOps environmentWithObservable
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
function environmentWithObservable_1(f) {
|
|
108
|
+
return new EnvironmentWith(f);
|
|
109
|
+
}
|
|
104
110
|
/**
|
|
105
111
|
* @tsplus static fncts.observable.ObservableOps failCause
|
|
106
112
|
*/
|
|
107
113
|
|
|
108
114
|
|
|
109
115
|
export function failCause(cause) {
|
|
110
|
-
return new
|
|
116
|
+
return new Observable(s => s.error(cause));
|
|
111
117
|
}
|
|
112
118
|
/**
|
|
113
119
|
* @tsplus static fncts.observable.ObservableOps fail
|
|
114
120
|
*/
|
|
115
121
|
|
|
116
122
|
function fail_1(e) {
|
|
117
|
-
return new
|
|
123
|
+
return new Observable(s => s.error(tsplus_module_1.fail(e)));
|
|
118
124
|
}
|
|
119
125
|
/**
|
|
120
126
|
* @tsplus static fncts.observable.ObservableOps from
|
|
@@ -122,31 +128,31 @@ function fail_1(e) {
|
|
|
122
128
|
|
|
123
129
|
|
|
124
130
|
function from_1(input) {
|
|
125
|
-
if (input instanceof
|
|
131
|
+
if (input instanceof Observable) {
|
|
126
132
|
return input;
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
if (
|
|
135
|
+
if (tsplus_module_2.isArrayLike(input)) {
|
|
130
136
|
return fromArrayLike(input);
|
|
131
137
|
}
|
|
132
138
|
|
|
133
|
-
if (
|
|
139
|
+
if (tsplus_module_2.isPromiseLike(input)) {
|
|
134
140
|
return fromPromise(input);
|
|
135
141
|
}
|
|
136
142
|
|
|
137
|
-
if (
|
|
143
|
+
if (tsplus_module_2.isAsyncIterable(input)) {
|
|
138
144
|
return fromAsyncIterable(input);
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
if (
|
|
147
|
+
if (tsplus_module_3.isIterable(input)) {
|
|
142
148
|
return fromIterable(input);
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
if (
|
|
151
|
+
if (tsplus_module_2.isReadableStream(input)) {
|
|
146
152
|
return fromReadableStreamLike(input);
|
|
147
153
|
}
|
|
148
154
|
|
|
149
|
-
if (
|
|
155
|
+
if (tsplus_module_4.isIO(input)) {
|
|
150
156
|
return fromIO_1(input);
|
|
151
157
|
}
|
|
152
158
|
|
|
@@ -158,7 +164,7 @@ function from_1(input) {
|
|
|
158
164
|
}
|
|
159
165
|
|
|
160
166
|
export function fromArrayLike(input) {
|
|
161
|
-
return new
|
|
167
|
+
return new Observable(s => {
|
|
162
168
|
for (let i = 0; i < input.length && !s.closed; i++) {
|
|
163
169
|
s.next(input[i]);
|
|
164
170
|
}
|
|
@@ -167,12 +173,12 @@ export function fromArrayLike(input) {
|
|
|
167
173
|
});
|
|
168
174
|
}
|
|
169
175
|
export function fromAsyncIterable(asyncIterable) {
|
|
170
|
-
return new
|
|
171
|
-
process(asyncIterable, s).catch(err => s.error(
|
|
176
|
+
return new Observable(s => {
|
|
177
|
+
process(asyncIterable, s).catch(err => s.error(tsplus_module_1.halt(err)));
|
|
172
178
|
});
|
|
173
179
|
}
|
|
174
180
|
export function fromIterable(iterable) {
|
|
175
|
-
return new
|
|
181
|
+
return new Observable(s => {
|
|
176
182
|
for (const value of iterable) {
|
|
177
183
|
s.next(value);
|
|
178
184
|
|
|
@@ -185,13 +191,13 @@ export function fromIterable(iterable) {
|
|
|
185
191
|
});
|
|
186
192
|
}
|
|
187
193
|
export function fromPromise(promise) {
|
|
188
|
-
return new
|
|
194
|
+
return new Observable(s => {
|
|
189
195
|
promise.then(value => {
|
|
190
196
|
if (!s.closed) {
|
|
191
197
|
s.next(value);
|
|
192
198
|
s.complete();
|
|
193
199
|
}
|
|
194
|
-
}, err => s.error(
|
|
200
|
+
}, err => s.error(tsplus_module_1.halt(err))).then(null, tsplus_module_2.reportUnhandledError);
|
|
195
201
|
});
|
|
196
202
|
}
|
|
197
203
|
export function fromReadableStreamLike(readableStream) {
|
|
@@ -202,13 +208,13 @@ export function fromReadableStreamLike(readableStream) {
|
|
|
202
208
|
*/
|
|
203
209
|
|
|
204
210
|
function fromSubscribable_1(subscribable) {
|
|
205
|
-
return new
|
|
211
|
+
return new Observable(subscriber => subscribable.subscribe(subscriber));
|
|
206
212
|
}
|
|
207
213
|
|
|
208
214
|
export function fromInterop(subscribable) {
|
|
209
|
-
return new
|
|
215
|
+
return new Observable(subscriber => subscribable.subscribe({
|
|
210
216
|
next: value => subscriber.next(value),
|
|
211
|
-
error: err => subscriber.error(
|
|
217
|
+
error: err => subscriber.error(tsplus_module_1.halt(err)),
|
|
212
218
|
complete: () => subscriber.complete()
|
|
213
219
|
}));
|
|
214
220
|
}
|
|
@@ -251,7 +257,7 @@ async function process(asyncIterable, subscriber) {
|
|
|
251
257
|
*/
|
|
252
258
|
|
|
253
259
|
|
|
254
|
-
function interval_1(period = 0, scheduler =
|
|
260
|
+
function interval_1(period = 0, scheduler = tsplus_module_5.asyncScheduler) {
|
|
255
261
|
if (period < 0) {
|
|
256
262
|
// eslint-disable-next-line no-param-reassign
|
|
257
263
|
period = 0;
|
|
@@ -268,15 +274,16 @@ export function merge(...sources) {
|
|
|
268
274
|
* @tsplus static fncts.observable.ObservableOps of
|
|
269
275
|
*/
|
|
270
276
|
|
|
271
|
-
|
|
277
|
+
function of_1(...items) {
|
|
272
278
|
return fromArrayLike(items);
|
|
273
279
|
}
|
|
274
280
|
/**
|
|
275
281
|
* @tsplus static fncts.observable.ObservableOps single
|
|
276
282
|
*/
|
|
277
283
|
|
|
284
|
+
|
|
278
285
|
function single_1(a) {
|
|
279
|
-
return new
|
|
286
|
+
return new Observable(s => {
|
|
280
287
|
s.next(a);
|
|
281
288
|
s.complete();
|
|
282
289
|
});
|
|
@@ -288,23 +295,23 @@ function single_1(a) {
|
|
|
288
295
|
|
|
289
296
|
|
|
290
297
|
function scheduled_1(input, scheduler) {
|
|
291
|
-
if (
|
|
298
|
+
if (tsplus_module_2.isArrayLike(input)) {
|
|
292
299
|
return scheduleArray(input, scheduler);
|
|
293
300
|
}
|
|
294
301
|
|
|
295
|
-
if (
|
|
302
|
+
if (tsplus_module_2.isPromiseLike(input)) {
|
|
296
303
|
return schedulePromise(input, scheduler);
|
|
297
304
|
}
|
|
298
305
|
|
|
299
|
-
if (
|
|
306
|
+
if (tsplus_module_3.isIterable(input)) {
|
|
300
307
|
return scheduleIterable(input, scheduler);
|
|
301
308
|
}
|
|
302
309
|
|
|
303
|
-
if (
|
|
310
|
+
if (tsplus_module_2.isAsyncIterable(input)) {
|
|
304
311
|
return scheduleAsyncIterable(input, scheduler);
|
|
305
312
|
}
|
|
306
313
|
|
|
307
|
-
if (
|
|
314
|
+
if (tsplus_module_2.isReadableStream(input)) {
|
|
308
315
|
return scheduleReadableStreamLike(input, scheduler);
|
|
309
316
|
}
|
|
310
317
|
|
|
@@ -312,7 +319,7 @@ function scheduled_1(input, scheduler) {
|
|
|
312
319
|
}
|
|
313
320
|
|
|
314
321
|
export function scheduleArray(input, scheduler) {
|
|
315
|
-
return new
|
|
322
|
+
return new Observable(s => {
|
|
316
323
|
let i = 0;
|
|
317
324
|
return scheduler.schedule(function () {
|
|
318
325
|
if (i === input.length) {
|
|
@@ -328,8 +335,8 @@ export function scheduleArray(input, scheduler) {
|
|
|
328
335
|
});
|
|
329
336
|
}
|
|
330
337
|
export function scheduleAsyncIterable(input, scheduler) {
|
|
331
|
-
return new
|
|
332
|
-
const sub = new
|
|
338
|
+
return new Observable(subscriber => {
|
|
339
|
+
const sub = new tsplus_module_6.Subscription();
|
|
333
340
|
sub.add(scheduler.schedule(() => {
|
|
334
341
|
const iterator = input[Symbol.asyncIterator]();
|
|
335
342
|
sub.add(scheduler.schedule(function () {
|
|
@@ -347,7 +354,7 @@ export function scheduleAsyncIterable(input, scheduler) {
|
|
|
347
354
|
});
|
|
348
355
|
}
|
|
349
356
|
export function scheduleIterable(input, scheduler) {
|
|
350
|
-
return new
|
|
357
|
+
return new Observable(s => {
|
|
351
358
|
let iterator;
|
|
352
359
|
s.add(scheduler.schedule(() => {
|
|
353
360
|
iterator = input[Symbol.iterator]();
|
|
@@ -365,12 +372,12 @@ export function scheduleIterable(input, scheduler) {
|
|
|
365
372
|
}
|
|
366
373
|
});
|
|
367
374
|
}));
|
|
368
|
-
return () =>
|
|
375
|
+
return () => tsplus_module_3.isFunction(iterator?.return) && iterator.return();
|
|
369
376
|
});
|
|
370
377
|
}
|
|
371
378
|
export function scheduleObservable(input, scheduler) {
|
|
372
|
-
return new
|
|
373
|
-
const sub = new
|
|
379
|
+
return new Observable(subscriber => {
|
|
380
|
+
const sub = new tsplus_module_6.Subscription();
|
|
374
381
|
sub.add(scheduler.schedule(() => {
|
|
375
382
|
sub.add(input.subscribe({
|
|
376
383
|
next: value => {
|
|
@@ -387,7 +394,7 @@ export function scheduleObservable(input, scheduler) {
|
|
|
387
394
|
});
|
|
388
395
|
}
|
|
389
396
|
export function schedulePromise(input, scheduler) {
|
|
390
|
-
return new
|
|
397
|
+
return new Observable(subscriber => {
|
|
391
398
|
return scheduler.schedule(() => {
|
|
392
399
|
input.then(value => {
|
|
393
400
|
subscriber.add(scheduler.schedule(() => {
|
|
@@ -395,7 +402,7 @@ export function schedulePromise(input, scheduler) {
|
|
|
395
402
|
subscriber.add(scheduler.schedule(() => subscriber.complete()));
|
|
396
403
|
}));
|
|
397
404
|
}, err => {
|
|
398
|
-
subscriber.add(scheduler.schedule(() => subscriber.error(
|
|
405
|
+
subscriber.add(scheduler.schedule(() => subscriber.error(tsplus_module_1.halt(err))));
|
|
399
406
|
});
|
|
400
407
|
});
|
|
401
408
|
});
|
|
@@ -404,11 +411,11 @@ export function scheduleReadableStreamLike(input, scheduler) {
|
|
|
404
411
|
return scheduleAsyncIterable(readableStreamToAsyncGenerator(input), scheduler);
|
|
405
412
|
}
|
|
406
413
|
|
|
407
|
-
function timer_1(time = 0, intervalOrScheduler, scheduler =
|
|
414
|
+
function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyncScheduler) {
|
|
408
415
|
let intervalDuration = -1;
|
|
409
416
|
|
|
410
417
|
if (intervalOrScheduler != null) {
|
|
411
|
-
if (
|
|
418
|
+
if (tsplus_module_7.isScheduler(intervalOrScheduler)) {
|
|
412
419
|
// eslint-disable-next-line no-param-reassign
|
|
413
420
|
scheduler = intervalOrScheduler;
|
|
414
421
|
} else {
|
|
@@ -416,8 +423,8 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_6.asyn
|
|
|
416
423
|
}
|
|
417
424
|
}
|
|
418
425
|
|
|
419
|
-
return new
|
|
420
|
-
let due =
|
|
426
|
+
return new Observable(s => {
|
|
427
|
+
let due = tsplus_module_2.isValidDate(time) ? +time - scheduler.now() : time;
|
|
421
428
|
|
|
422
429
|
if (due < 0) {
|
|
423
430
|
due = 0;
|
|
@@ -443,7 +450,7 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_6.asyn
|
|
|
443
450
|
|
|
444
451
|
|
|
445
452
|
export function makeZip(...sources) {
|
|
446
|
-
return sources.length ? new
|
|
453
|
+
return sources.length ? new Observable(subscriber => {
|
|
447
454
|
let buffers = sources.map(() => []);
|
|
448
455
|
let completed = sources.map(() => false);
|
|
449
456
|
subscriber.add(() => {
|
|
@@ -451,7 +458,7 @@ export function makeZip(...sources) {
|
|
|
451
458
|
});
|
|
452
459
|
|
|
453
460
|
for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
|
|
454
|
-
from_1(sources[sourceIndex]).subscribe(
|
|
461
|
+
from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
455
462
|
next: value => {
|
|
456
463
|
buffers[sourceIndex].push(value);
|
|
457
464
|
|
|
@@ -480,11 +487,11 @@ export function makeZip(...sources) {
|
|
|
480
487
|
* @tsplus static fncts.observable.ObservableOps fromIO
|
|
481
488
|
*/
|
|
482
489
|
|
|
483
|
-
function fromIO_1(io, scheduler =
|
|
484
|
-
return new
|
|
490
|
+
function fromIO_1(io, scheduler = tsplus_module_5.asyncScheduler) {
|
|
491
|
+
return new Observable((s, env) => {
|
|
485
492
|
let fiber;
|
|
486
493
|
const scheduled = scheduler.schedule(() => {
|
|
487
|
-
fiber = tsplus_module_10.unsafeRunFiber(io, fileName_1 + ":
|
|
494
|
+
fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.provideEnvironment_(io, env, fileName_1 + ":487:36"), fileName_1 + ":487:56");
|
|
488
495
|
fiber.unsafeOnDone(exit => {
|
|
489
496
|
if (!s.closed) {
|
|
490
497
|
tsplus_module_11.match_(tsplus_module_11.flatten(exit), cause => s.error(cause), a => s.next(a));
|
|
@@ -494,28 +501,16 @@ function fromIO_1(io, scheduler = tsplus_module_6.asyncScheduler) {
|
|
|
494
501
|
});
|
|
495
502
|
return () => {
|
|
496
503
|
scheduled.unsubscribe();
|
|
497
|
-
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber), fileName_1 + ":
|
|
504
|
+
fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber, fileName_1 + ":500:21"), fileName_1 + ":500:46");
|
|
498
505
|
};
|
|
499
506
|
});
|
|
500
507
|
}
|
|
501
|
-
/*
|
|
502
|
-
* -------------------------------------------------------------------------------------------------
|
|
503
|
-
* Applicative
|
|
504
|
-
* -------------------------------------------------------------------------------------------------
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
508
|
/**
|
|
508
509
|
* @tsplus static fncts.observable.ObservableOps unit
|
|
509
510
|
*/
|
|
510
511
|
|
|
511
512
|
|
|
512
513
|
export const unit = /*#__PURE__*/single_1(undefined);
|
|
513
|
-
/*
|
|
514
|
-
* -------------------------------------------------------------------------------------------------
|
|
515
|
-
* Apply
|
|
516
|
-
* -------------------------------------------------------------------------------------------------
|
|
517
|
-
*/
|
|
518
|
-
|
|
519
514
|
/**
|
|
520
515
|
* @tsplus fluent fncts.observable.Observable zipWith
|
|
521
516
|
*/
|
|
@@ -538,20 +533,14 @@ export function zip(fa, fb) {
|
|
|
538
533
|
export function ap(fab, fa) {
|
|
539
534
|
return zipWith_1(fab, fa, (f, a) => f(a));
|
|
540
535
|
}
|
|
541
|
-
/*
|
|
542
|
-
* -------------------------------------------------------------------------------------------------
|
|
543
|
-
* Functor
|
|
544
|
-
* -------------------------------------------------------------------------------------------------
|
|
545
|
-
*/
|
|
546
|
-
|
|
547
536
|
/**
|
|
548
537
|
* @tsplus fluent fncts.observable.Observable mapWithIndex
|
|
549
538
|
*/
|
|
550
539
|
|
|
551
540
|
function mapWithIndex_1(fa, f) {
|
|
552
|
-
return
|
|
541
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
553
542
|
let i = 0;
|
|
554
|
-
source.subscribe(new
|
|
543
|
+
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
555
544
|
next: value => {
|
|
556
545
|
subscriber.next(f(i++, value));
|
|
557
546
|
}
|
|
@@ -574,22 +563,16 @@ function map_1(fa, f) {
|
|
|
574
563
|
function as_1(fa, b) {
|
|
575
564
|
return map_1(fa, b);
|
|
576
565
|
}
|
|
577
|
-
/*
|
|
578
|
-
* -------------------------------------------------------------------------------------------------
|
|
579
|
-
* Bifunctor
|
|
580
|
-
* -------------------------------------------------------------------------------------------------
|
|
581
|
-
*/
|
|
582
|
-
|
|
583
566
|
/**
|
|
584
567
|
* @tsplus fluent fncts.observable.Observable mapError
|
|
585
568
|
*/
|
|
586
569
|
|
|
587
570
|
|
|
588
571
|
export function mapError_(fa, f) {
|
|
589
|
-
return
|
|
590
|
-
source.subscribe(new
|
|
572
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
573
|
+
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
591
574
|
error: err => {
|
|
592
|
-
subscriber.error(
|
|
575
|
+
subscriber.error(tsplus_module_1.map_(err, f));
|
|
593
576
|
}
|
|
594
577
|
}));
|
|
595
578
|
});
|
|
@@ -599,13 +582,13 @@ export function mapError_(fa, f) {
|
|
|
599
582
|
*/
|
|
600
583
|
|
|
601
584
|
export function swap(fa) {
|
|
602
|
-
return
|
|
603
|
-
source.subscribe(new
|
|
585
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
586
|
+
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
604
587
|
next: value => {
|
|
605
|
-
subscriber.error(
|
|
588
|
+
subscriber.error(tsplus_module_1.fail(value));
|
|
606
589
|
},
|
|
607
590
|
error: err => {
|
|
608
|
-
tsplus_module_14.match_(
|
|
591
|
+
tsplus_module_14.match_(tsplus_module_1.failureOrCause(err), e => {
|
|
609
592
|
subscriber.next(e);
|
|
610
593
|
}, cause => {
|
|
611
594
|
subscriber.error(cause);
|
|
@@ -616,9 +599,9 @@ export function swap(fa) {
|
|
|
616
599
|
}
|
|
617
600
|
|
|
618
601
|
function filterWithIndex_1(fa, predicate) {
|
|
619
|
-
return
|
|
602
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
620
603
|
let index = 0;
|
|
621
|
-
source.subscribe(
|
|
604
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
622
605
|
next: value => predicate(index++, value) && subscriber.next(value)
|
|
623
606
|
}));
|
|
624
607
|
});
|
|
@@ -632,10 +615,10 @@ export function filter_(fa, predicate) {
|
|
|
632
615
|
*/
|
|
633
616
|
|
|
634
617
|
function filterMapWithIndex_1(fa, f) {
|
|
635
|
-
return
|
|
618
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
636
619
|
let index = 0;
|
|
637
|
-
source.subscribe(
|
|
638
|
-
next: value => tsplus_module_15.match_(f(index++, value), () =>
|
|
620
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
621
|
+
next: value => tsplus_module_15.match_(f(index++, value), () => tsplus_module_2.noop, b => subscriber.next(b))
|
|
639
622
|
}));
|
|
640
623
|
});
|
|
641
624
|
}
|
|
@@ -660,18 +643,18 @@ export function partition_(fa, predicate) {
|
|
|
660
643
|
*/
|
|
661
644
|
|
|
662
645
|
function partitionMapWithIndex_1(fa, f) {
|
|
663
|
-
return [
|
|
646
|
+
return [tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
664
647
|
let index = 0;
|
|
665
|
-
source.subscribe(
|
|
648
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
666
649
|
next: value => {
|
|
667
|
-
tsplus_module_14.match_(f(index++, value), b => subscriber.next(b),
|
|
650
|
+
tsplus_module_14.match_(f(index++, value), b => subscriber.next(b), tsplus_module_2.noop);
|
|
668
651
|
}
|
|
669
652
|
}));
|
|
670
|
-
}),
|
|
653
|
+
}), tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
671
654
|
let index = 0;
|
|
672
|
-
source.subscribe(
|
|
655
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
673
656
|
next: value => {
|
|
674
|
-
tsplus_module_14.match_(f(index++, value),
|
|
657
|
+
tsplus_module_14.match_(f(index++, value), tsplus_module_2.noop, c => subscriber.next(c));
|
|
675
658
|
}
|
|
676
659
|
}));
|
|
677
660
|
})];
|
|
@@ -684,18 +667,28 @@ function partitionMapWithIndex_1(fa, f) {
|
|
|
684
667
|
export function partitionMap_(fa, f) {
|
|
685
668
|
return partitionMapWithIndex_1(fa, (_, a) => f(a));
|
|
686
669
|
}
|
|
687
|
-
|
|
688
|
-
*
|
|
689
|
-
|
|
690
|
-
|
|
670
|
+
/**
|
|
671
|
+
* @tsplus fluent fncts.observable.Observable provideEnvironment
|
|
672
|
+
*/
|
|
673
|
+
|
|
674
|
+
export function provideEnvironment(self, environment) {
|
|
675
|
+
return self.provide(environment);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* @tsplus fluent fncts.observable.Observable provideService
|
|
691
679
|
*/
|
|
692
680
|
|
|
681
|
+
export function provideService(self, service,
|
|
682
|
+
/** @tsplus auto */
|
|
683
|
+
tag) {
|
|
684
|
+
return contramapEnvironment_1(self, environment => tsplus_module_16.add(environment, service, tag));
|
|
685
|
+
}
|
|
693
686
|
/**
|
|
694
687
|
* @tsplus fluent fncts.observable.Observable mergeMapWithIndex
|
|
695
688
|
*/
|
|
696
689
|
|
|
697
690
|
function mergeMapWithIndex_1(ma, f, concurrent = Infinity) {
|
|
698
|
-
return
|
|
691
|
+
return tsplus_module_8.operate_(ma, (source, sub) => mergeInternal(source, sub, f, concurrent));
|
|
699
692
|
}
|
|
700
693
|
/**
|
|
701
694
|
* @tsplus fluent fncts.observable.Observable mergeMap
|
|
@@ -720,25 +713,27 @@ export function concatMapWithIndex(ma, f) {
|
|
|
720
713
|
export function concatMap_(ma, f) {
|
|
721
714
|
return mergeMapWithIndex_1(ma, (_, a) => f(a), 1);
|
|
722
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* @tsplus fluent fncts.observable.Observable contramapEnvironment
|
|
718
|
+
*/
|
|
719
|
+
|
|
720
|
+
function contramapEnvironment_1(self, f) {
|
|
721
|
+
return environmentWithObservable_1(environment => self.provide(f(environment)));
|
|
722
|
+
}
|
|
723
723
|
/**
|
|
724
724
|
* @tsplus getter fncts.observable.Observable flatten
|
|
725
725
|
*/
|
|
726
726
|
|
|
727
|
+
|
|
727
728
|
export function flatten(mma) {
|
|
728
729
|
return concatAll_1(mma);
|
|
729
730
|
}
|
|
730
|
-
/*
|
|
731
|
-
* -------------------------------------------------------------------------------------------------
|
|
732
|
-
* Foldable
|
|
733
|
-
* -------------------------------------------------------------------------------------------------
|
|
734
|
-
*/
|
|
735
|
-
|
|
736
731
|
/**
|
|
737
732
|
* @tsplus fluent fncts.observable.Observable foldLeftWithIndex
|
|
738
733
|
*/
|
|
739
734
|
|
|
740
735
|
function foldLeftWithIndex_1(fa, initial, f) {
|
|
741
|
-
return
|
|
736
|
+
return tsplus_module_8.operate_(fa, scanInternal(f, initial, true, false, true));
|
|
742
737
|
}
|
|
743
738
|
/**
|
|
744
739
|
* @tsplus fluent fncts.observable.Observable foldLeft
|
|
@@ -748,27 +743,21 @@ function foldLeftWithIndex_1(fa, initial, f) {
|
|
|
748
743
|
function foldLeft_1(fa, initial, f) {
|
|
749
744
|
return foldLeftWithIndex_1(fa, initial, (_, b, a) => f(b, a));
|
|
750
745
|
}
|
|
751
|
-
/*
|
|
752
|
-
* -------------------------------------------------------------------------------------------------
|
|
753
|
-
* combinators
|
|
754
|
-
* -------------------------------------------------------------------------------------------------
|
|
755
|
-
*/
|
|
756
|
-
|
|
757
746
|
/**
|
|
758
747
|
* @tsplus fluent fncts.observable.Observable at
|
|
759
748
|
*/
|
|
760
749
|
|
|
761
750
|
|
|
762
751
|
export function at_(fa, index) {
|
|
763
|
-
return onEmpty_1(map_1(take_1(filterWithIndex_1(fa, i => i === index), 1),
|
|
752
|
+
return onEmpty_1(map_1(take_1(filterWithIndex_1(fa, i => i === index), 1), tsplus_module_17.just), () => tsplus_module_17.nothing());
|
|
764
753
|
}
|
|
765
754
|
/**
|
|
766
755
|
* @tsplus fluent fncts.observable.Observable audit
|
|
767
756
|
*/
|
|
768
757
|
|
|
769
758
|
function audit_1(fa, durationSelector) {
|
|
770
|
-
return
|
|
771
|
-
let lastValue =
|
|
759
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
760
|
+
let lastValue = tsplus_module_17.nothing();
|
|
772
761
|
let durationSubscriber = null;
|
|
773
762
|
let isComplete = false;
|
|
774
763
|
|
|
@@ -776,11 +765,11 @@ function audit_1(fa, durationSelector) {
|
|
|
776
765
|
durationSubscriber?.unsubscribe();
|
|
777
766
|
durationSubscriber = null;
|
|
778
767
|
|
|
779
|
-
if (
|
|
768
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
780
769
|
const {
|
|
781
770
|
value
|
|
782
771
|
} = lastValue;
|
|
783
|
-
lastValue =
|
|
772
|
+
lastValue = tsplus_module_17.nothing();
|
|
784
773
|
subscriber.next(value);
|
|
785
774
|
}
|
|
786
775
|
|
|
@@ -792,12 +781,12 @@ function audit_1(fa, durationSelector) {
|
|
|
792
781
|
isComplete && subscriber.complete();
|
|
793
782
|
};
|
|
794
783
|
|
|
795
|
-
source.subscribe(
|
|
784
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
796
785
|
next: value => {
|
|
797
|
-
lastValue =
|
|
786
|
+
lastValue = tsplus_module_17.just(value);
|
|
798
787
|
|
|
799
788
|
if (!durationSubscriber) {
|
|
800
|
-
from_1(durationSelector(value)).subscribe(durationSubscriber =
|
|
789
|
+
from_1(durationSelector(value)).subscribe(durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
801
790
|
next: endDuration,
|
|
802
791
|
complete: cleanupDuration
|
|
803
792
|
}));
|
|
@@ -805,7 +794,7 @@ function audit_1(fa, durationSelector) {
|
|
|
805
794
|
},
|
|
806
795
|
complete: () => {
|
|
807
796
|
isComplete = true;
|
|
808
|
-
(
|
|
797
|
+
(tsplus_module_18.isNothing(lastValue) || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
809
798
|
}
|
|
810
799
|
}));
|
|
811
800
|
});
|
|
@@ -815,7 +804,7 @@ function audit_1(fa, durationSelector) {
|
|
|
815
804
|
*/
|
|
816
805
|
|
|
817
806
|
|
|
818
|
-
export function auditTime_(fa, duration, scheduler =
|
|
807
|
+
export function auditTime_(fa, duration, scheduler = tsplus_module_5.asyncScheduler) {
|
|
819
808
|
return audit_1(fa, () => timer_1(duration, scheduler));
|
|
820
809
|
}
|
|
821
810
|
/**
|
|
@@ -823,22 +812,22 @@ export function auditTime_(fa, duration, scheduler = tsplus_module_6.asyncSchedu
|
|
|
823
812
|
*/
|
|
824
813
|
|
|
825
814
|
export function buffer_(fa, closingNotifier) {
|
|
826
|
-
return
|
|
815
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
827
816
|
let buffer = [];
|
|
828
|
-
source.subscribe(
|
|
817
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
829
818
|
next: value => buffer.push(value),
|
|
830
819
|
complete: () => {
|
|
831
820
|
subscriber.next(buffer);
|
|
832
821
|
subscriber.complete();
|
|
833
822
|
}
|
|
834
823
|
}));
|
|
835
|
-
closingNotifier.subscribe(
|
|
824
|
+
closingNotifier.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
836
825
|
next: () => {
|
|
837
826
|
const b = buffer;
|
|
838
827
|
buffer = [];
|
|
839
828
|
subscriber.next(b);
|
|
840
829
|
},
|
|
841
|
-
complete:
|
|
830
|
+
complete: tsplus_module_2.noop
|
|
842
831
|
}));
|
|
843
832
|
return () => {
|
|
844
833
|
buffer = null;
|
|
@@ -852,10 +841,10 @@ export function buffer_(fa, closingNotifier) {
|
|
|
852
841
|
export function bufferCount_(fa, bufferSize, startBufferEvery) {
|
|
853
842
|
// eslint-disable-next-line no-param-reassign
|
|
854
843
|
startBufferEvery = startBufferEvery ?? bufferSize;
|
|
855
|
-
return
|
|
844
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
856
845
|
let buffers = [];
|
|
857
846
|
let count = 0;
|
|
858
|
-
source.subscribe(
|
|
847
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
859
848
|
next: value => {
|
|
860
849
|
let toEmit = null;
|
|
861
850
|
|
|
@@ -900,9 +889,9 @@ export function bufferTime_(fa, config) {
|
|
|
900
889
|
bufferTimeSpan,
|
|
901
890
|
bufferCreationInterval = null,
|
|
902
891
|
maxBufferSize = Infinity,
|
|
903
|
-
scheduler =
|
|
892
|
+
scheduler = tsplus_module_5.asyncScheduler
|
|
904
893
|
} = config;
|
|
905
|
-
return
|
|
894
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
906
895
|
let bufferRecords = [];
|
|
907
896
|
let restartOnEmit = true;
|
|
908
897
|
|
|
@@ -919,7 +908,7 @@ export function bufferTime_(fa, config) {
|
|
|
919
908
|
|
|
920
909
|
const startBuffer = () => {
|
|
921
910
|
if (bufferRecords) {
|
|
922
|
-
const subs = new
|
|
911
|
+
const subs = new tsplus_module_6.Subscription();
|
|
923
912
|
subscriber.add(subs);
|
|
924
913
|
const buffer = [];
|
|
925
914
|
const record = {
|
|
@@ -936,7 +925,7 @@ export function bufferTime_(fa, config) {
|
|
|
936
925
|
!this.closed && subscriber.add(this.schedule(null, bufferCreationInterval));
|
|
937
926
|
}, bufferCreationInterval)) : restartOnEmit = true;
|
|
938
927
|
startBuffer();
|
|
939
|
-
const bufferTimeSubscriber =
|
|
928
|
+
const bufferTimeSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
940
929
|
next: value => {
|
|
941
930
|
const recordsCopy = bufferRecords.slice();
|
|
942
931
|
|
|
@@ -966,13 +955,13 @@ export function bufferTime_(fa, config) {
|
|
|
966
955
|
*/
|
|
967
956
|
|
|
968
957
|
export function bufferToggle_(fa, openings, closingSelector) {
|
|
969
|
-
return
|
|
958
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
970
959
|
const buffers = [];
|
|
971
|
-
from_1(openings).subscribe(
|
|
960
|
+
from_1(openings).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
972
961
|
next: openValue => {
|
|
973
962
|
const buffer = [];
|
|
974
963
|
buffers.push(buffer);
|
|
975
|
-
const closingSubscription = new
|
|
964
|
+
const closingSubscription = new tsplus_module_6.Subscription();
|
|
976
965
|
|
|
977
966
|
const emitBuffer = () => {
|
|
978
967
|
arrayRemove(buffers, buffer);
|
|
@@ -980,14 +969,14 @@ export function bufferToggle_(fa, openings, closingSelector) {
|
|
|
980
969
|
closingSubscription.unsubscribe();
|
|
981
970
|
};
|
|
982
971
|
|
|
983
|
-
closingSubscription.add(from_1(closingSelector(openValue)).subscribe(
|
|
972
|
+
closingSubscription.add(from_1(closingSelector(openValue)).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
984
973
|
next: emitBuffer,
|
|
985
|
-
complete:
|
|
974
|
+
complete: tsplus_module_2.noop
|
|
986
975
|
})));
|
|
987
976
|
},
|
|
988
|
-
complete:
|
|
977
|
+
complete: tsplus_module_2.noop
|
|
989
978
|
}));
|
|
990
|
-
source.subscribe(
|
|
979
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
991
980
|
next: value => {
|
|
992
981
|
for (const buffer of buffers) {
|
|
993
982
|
buffer.push(value);
|
|
@@ -1007,8 +996,8 @@ export function bufferToggle_(fa, openings, closingSelector) {
|
|
|
1007
996
|
* @tsplus fluent fncts.observable.Observable bufferWhen
|
|
1008
997
|
*/
|
|
1009
998
|
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
999
|
+
export function bufferWhen_(fa, closingSelector) {
|
|
1000
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1012
1001
|
let buffer = null;
|
|
1013
1002
|
let closingSubscriber = null;
|
|
1014
1003
|
|
|
@@ -1017,14 +1006,14 @@ function bufferWhen_1(fa, closingSelector) {
|
|
|
1017
1006
|
const b = buffer;
|
|
1018
1007
|
buffer = [];
|
|
1019
1008
|
b && subscriber.next(b);
|
|
1020
|
-
from_1(closingSelector()).subscribe(closingSubscriber =
|
|
1009
|
+
from_1(closingSelector()).subscribe(closingSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1021
1010
|
next: openBuffer,
|
|
1022
|
-
complete:
|
|
1011
|
+
complete: tsplus_module_2.noop
|
|
1023
1012
|
}));
|
|
1024
1013
|
};
|
|
1025
1014
|
|
|
1026
1015
|
openBuffer();
|
|
1027
|
-
source.subscribe(
|
|
1016
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1028
1017
|
next: value => buffer?.push(value),
|
|
1029
1018
|
complete: () => {
|
|
1030
1019
|
buffer && subscriber.next(buffer);
|
|
@@ -1033,20 +1022,16 @@ function bufferWhen_1(fa, closingSelector) {
|
|
|
1033
1022
|
}, () => buffer = closingSubscriber = null));
|
|
1034
1023
|
});
|
|
1035
1024
|
}
|
|
1036
|
-
|
|
1037
|
-
export function bufferWhen(closingSelector) {
|
|
1038
|
-
return fa => bufferWhen_1(fa, closingSelector);
|
|
1039
|
-
}
|
|
1040
1025
|
/**
|
|
1041
1026
|
* @tsplus fluent fncts.observable.Observable catchAllCause
|
|
1042
1027
|
*/
|
|
1043
1028
|
|
|
1044
1029
|
function catchAllCause_1(self, f) {
|
|
1045
|
-
return
|
|
1030
|
+
return tsplus_module_8.operate_(self, (source, subscriber) => {
|
|
1046
1031
|
let innerSub = null;
|
|
1047
1032
|
let syncUnsub = false;
|
|
1048
1033
|
let handledResult;
|
|
1049
|
-
innerSub = source.subscribe(
|
|
1034
|
+
innerSub = source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1050
1035
|
error: cause => {
|
|
1051
1036
|
handledResult = from_1(f(cause, catchAllCause_1(source, f)));
|
|
1052
1037
|
|
|
@@ -1081,7 +1066,7 @@ function concatAll_1(ffa) {
|
|
|
1081
1066
|
|
|
1082
1067
|
|
|
1083
1068
|
function concat_1(fa, ...sources) {
|
|
1084
|
-
return
|
|
1069
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1085
1070
|
concatAll_1(fromArrayLike([source, ...sources])).subscribe(subscriber);
|
|
1086
1071
|
});
|
|
1087
1072
|
}
|
|
@@ -1124,7 +1109,7 @@ function combineLatest_1(self, ...sources) {
|
|
|
1124
1109
|
return from_1(self).unsafeCoerce();
|
|
1125
1110
|
}
|
|
1126
1111
|
|
|
1127
|
-
return
|
|
1112
|
+
return tsplus_module_8.operate_(from_1(self), (source, subscriber) => {
|
|
1128
1113
|
combineLatestInternal(subscriber, [source, ...sources]);
|
|
1129
1114
|
});
|
|
1130
1115
|
}
|
|
@@ -1134,30 +1119,30 @@ function combineLatest_1(self, ...sources) {
|
|
|
1134
1119
|
|
|
1135
1120
|
|
|
1136
1121
|
export function debounceWith_(fa, durationSelector) {
|
|
1137
|
-
return
|
|
1138
|
-
let lastValue =
|
|
1122
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1123
|
+
let lastValue = tsplus_module_17.nothing();
|
|
1139
1124
|
let durationSubscriber = null;
|
|
1140
1125
|
|
|
1141
1126
|
const emit = () => {
|
|
1142
1127
|
durationSubscriber?.unsubscribe();
|
|
1143
1128
|
durationSubscriber = null;
|
|
1144
1129
|
|
|
1145
|
-
if (
|
|
1130
|
+
if (tsplus_module_18.isJust(lastValue)) {
|
|
1146
1131
|
const {
|
|
1147
1132
|
value
|
|
1148
1133
|
} = lastValue;
|
|
1149
|
-
lastValue =
|
|
1134
|
+
lastValue = tsplus_module_17.nothing();
|
|
1150
1135
|
subscriber.next(value);
|
|
1151
1136
|
}
|
|
1152
1137
|
};
|
|
1153
1138
|
|
|
1154
|
-
source.subscribe(
|
|
1139
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1155
1140
|
next: value => {
|
|
1156
1141
|
durationSubscriber?.unsubscribe();
|
|
1157
|
-
lastValue =
|
|
1158
|
-
durationSubscriber =
|
|
1142
|
+
lastValue = tsplus_module_17.just(value);
|
|
1143
|
+
durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1159
1144
|
next: emit,
|
|
1160
|
-
complete:
|
|
1145
|
+
complete: tsplus_module_2.noop
|
|
1161
1146
|
});
|
|
1162
1147
|
from_1(durationSelector(value)).subscribe(durationSubscriber);
|
|
1163
1148
|
},
|
|
@@ -1174,8 +1159,8 @@ export function debounceWith_(fa, durationSelector) {
|
|
|
1174
1159
|
* @tsplus fluent fncts.observable.Observable debounce
|
|
1175
1160
|
*/
|
|
1176
1161
|
|
|
1177
|
-
export function debounce_(fa, dueTime, scheduler =
|
|
1178
|
-
return
|
|
1162
|
+
export function debounce_(fa, dueTime, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1163
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1179
1164
|
let activeTask = null;
|
|
1180
1165
|
let lastValue = null;
|
|
1181
1166
|
let lastTime = null;
|
|
@@ -1203,7 +1188,7 @@ export function debounce_(fa, dueTime, scheduler = tsplus_module_6.asyncSchedule
|
|
|
1203
1188
|
emit();
|
|
1204
1189
|
}
|
|
1205
1190
|
|
|
1206
|
-
source.subscribe(
|
|
1191
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1207
1192
|
next: value => {
|
|
1208
1193
|
lastValue = value;
|
|
1209
1194
|
lastTime = scheduler.now();
|
|
@@ -1227,13 +1212,13 @@ export function debounce_(fa, dueTime, scheduler = tsplus_module_6.asyncSchedule
|
|
|
1227
1212
|
*/
|
|
1228
1213
|
|
|
1229
1214
|
export function either(fa) {
|
|
1230
|
-
return
|
|
1231
|
-
source.subscribe(
|
|
1215
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1216
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1232
1217
|
next: value => {
|
|
1233
|
-
subscriber.next(
|
|
1218
|
+
subscriber.next(tsplus_module_19.right(value));
|
|
1234
1219
|
},
|
|
1235
1220
|
error: error => {
|
|
1236
|
-
tsplus_module_14.match_(
|
|
1221
|
+
tsplus_module_14.match_(tsplus_module_1.failureOrCause(error), e => subscriber.next(tsplus_module_19.left(e)), cause => subscriber.error(cause));
|
|
1237
1222
|
}
|
|
1238
1223
|
}));
|
|
1239
1224
|
});
|
|
@@ -1258,7 +1243,7 @@ function delayWith_1(fa, f) {
|
|
|
1258
1243
|
*/
|
|
1259
1244
|
|
|
1260
1245
|
|
|
1261
|
-
export function delay_(fa, due, scheduler =
|
|
1246
|
+
export function delay_(fa, due, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1262
1247
|
const duration = timer_1(due, scheduler);
|
|
1263
1248
|
return delayWith_1(fa, () => duration);
|
|
1264
1249
|
}
|
|
@@ -1267,9 +1252,9 @@ export function delay_(fa, due, scheduler = tsplus_module_6.asyncScheduler) {
|
|
|
1267
1252
|
*/
|
|
1268
1253
|
|
|
1269
1254
|
export function dematerialize(fa) {
|
|
1270
|
-
return
|
|
1271
|
-
source.subscribe(
|
|
1272
|
-
next: notification =>
|
|
1255
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1256
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1257
|
+
next: notification => tsplus_module_20.observe_(notification, subscriber)
|
|
1273
1258
|
}));
|
|
1274
1259
|
});
|
|
1275
1260
|
}
|
|
@@ -1278,7 +1263,7 @@ export function dematerialize(fa) {
|
|
|
1278
1263
|
*/
|
|
1279
1264
|
|
|
1280
1265
|
export function ensuring_(fa, finalizer) {
|
|
1281
|
-
return
|
|
1266
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1282
1267
|
source.subscribe(subscriber);
|
|
1283
1268
|
subscriber.add(finalizer);
|
|
1284
1269
|
});
|
|
@@ -1288,13 +1273,13 @@ export function ensuring_(fa, finalizer) {
|
|
|
1288
1273
|
*/
|
|
1289
1274
|
|
|
1290
1275
|
export function exhaustAll(ffa) {
|
|
1291
|
-
return
|
|
1276
|
+
return tsplus_module_8.operate_(ffa, (source, subscriber) => {
|
|
1292
1277
|
let isComplete = false;
|
|
1293
1278
|
let innerSub = null;
|
|
1294
|
-
source.subscribe(
|
|
1279
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1295
1280
|
next: inner => {
|
|
1296
1281
|
if (!innerSub) {
|
|
1297
|
-
innerSub = from_1(inner).subscribe(
|
|
1282
|
+
innerSub = from_1(inner).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1298
1283
|
complete: () => {
|
|
1299
1284
|
innerSub = null;
|
|
1300
1285
|
isComplete && subscriber.complete();
|
|
@@ -1314,14 +1299,14 @@ export function exhaustAll(ffa) {
|
|
|
1314
1299
|
*/
|
|
1315
1300
|
|
|
1316
1301
|
function exhaustMapWithIndex_1(self, f) {
|
|
1317
|
-
return
|
|
1302
|
+
return tsplus_module_8.operate_(self, (source, subscriber) => {
|
|
1318
1303
|
let index = 0;
|
|
1319
1304
|
let innerSub = null;
|
|
1320
1305
|
let isComplete = false;
|
|
1321
|
-
source.subscribe(
|
|
1306
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1322
1307
|
next: outerValue => {
|
|
1323
1308
|
if (!innerSub) {
|
|
1324
|
-
innerSub =
|
|
1309
|
+
innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1325
1310
|
complete: () => {
|
|
1326
1311
|
innerSub = null;
|
|
1327
1312
|
isComplete && subscriber.complete();
|
|
@@ -1352,7 +1337,7 @@ export function exhaustMap_(self, f) {
|
|
|
1352
1337
|
function expandWithIndex_1(fa, f, concurrent = Infinity) {
|
|
1353
1338
|
// eslint-disable-next-line no-param-reassign
|
|
1354
1339
|
concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
|
|
1355
|
-
return
|
|
1340
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => mergeInternal(source, subscriber, f, concurrent, undefined, true));
|
|
1356
1341
|
}
|
|
1357
1342
|
/**
|
|
1358
1343
|
* @tsplus fluent fncts.observable.Observable expand
|
|
@@ -1364,7 +1349,7 @@ export function expand_(fa, f, concurrent = Infinity) {
|
|
|
1364
1349
|
}
|
|
1365
1350
|
|
|
1366
1351
|
function findWithIndex_1(fa, predicate) {
|
|
1367
|
-
return
|
|
1352
|
+
return tsplus_module_8.operate_(fa, findInternal(predicate, "value"));
|
|
1368
1353
|
}
|
|
1369
1354
|
|
|
1370
1355
|
export function find_(fa, predicate) {
|
|
@@ -1372,7 +1357,7 @@ export function find_(fa, predicate) {
|
|
|
1372
1357
|
}
|
|
1373
1358
|
|
|
1374
1359
|
function findIndexWithIndex_1(fa, predicate) {
|
|
1375
|
-
return
|
|
1360
|
+
return tsplus_module_8.operate_(fa, findInternal(predicate, "index"));
|
|
1376
1361
|
}
|
|
1377
1362
|
|
|
1378
1363
|
export function findIndex_(fa, predicate) {
|
|
@@ -1383,7 +1368,7 @@ export function forkJoin(...args) {
|
|
|
1383
1368
|
args: sources,
|
|
1384
1369
|
keys
|
|
1385
1370
|
} = arrayOrObject(args);
|
|
1386
|
-
return new
|
|
1371
|
+
return new Observable(s => {
|
|
1387
1372
|
const length = sources.length;
|
|
1388
1373
|
|
|
1389
1374
|
if (!length) {
|
|
@@ -1397,7 +1382,7 @@ export function forkJoin(...args) {
|
|
|
1397
1382
|
|
|
1398
1383
|
for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
|
|
1399
1384
|
let hasValue = false;
|
|
1400
|
-
from_1(sources[sourceIndex]).subscribe(
|
|
1385
|
+
from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(s, {
|
|
1401
1386
|
next: value => {
|
|
1402
1387
|
if (!hasValue) {
|
|
1403
1388
|
hasValue = true;
|
|
@@ -1427,9 +1412,9 @@ export function forkJoin(...args) {
|
|
|
1427
1412
|
*/
|
|
1428
1413
|
|
|
1429
1414
|
export function ignore(fa) {
|
|
1430
|
-
return
|
|
1431
|
-
source.subscribe(
|
|
1432
|
-
next:
|
|
1415
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1416
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1417
|
+
next: tsplus_module_2.noop
|
|
1433
1418
|
}));
|
|
1434
1419
|
});
|
|
1435
1420
|
}
|
|
@@ -1438,8 +1423,8 @@ export function ignore(fa) {
|
|
|
1438
1423
|
*/
|
|
1439
1424
|
|
|
1440
1425
|
export function isEmpty(fa) {
|
|
1441
|
-
return
|
|
1442
|
-
source.subscribe(
|
|
1426
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1427
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1443
1428
|
next: () => {
|
|
1444
1429
|
subscriber.next(false);
|
|
1445
1430
|
subscriber.complete();
|
|
@@ -1456,16 +1441,16 @@ export function isEmpty(fa) {
|
|
|
1456
1441
|
*/
|
|
1457
1442
|
|
|
1458
1443
|
export function materialize(fa) {
|
|
1459
|
-
return
|
|
1460
|
-
source.subscribe(
|
|
1444
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1445
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1461
1446
|
next: value => {
|
|
1462
|
-
subscriber.next(
|
|
1447
|
+
subscriber.next(tsplus_module_20.next(value));
|
|
1463
1448
|
},
|
|
1464
1449
|
error: error => {
|
|
1465
|
-
subscriber.next(
|
|
1450
|
+
subscriber.next(tsplus_module_20.error(error));
|
|
1466
1451
|
},
|
|
1467
1452
|
complete: () => {
|
|
1468
|
-
subscriber.next(
|
|
1453
|
+
subscriber.next(tsplus_module_20.complete());
|
|
1469
1454
|
}
|
|
1470
1455
|
}));
|
|
1471
1456
|
});
|
|
@@ -1483,7 +1468,7 @@ function mergeAll_1(self, concurrent = Infinity) {
|
|
|
1483
1468
|
|
|
1484
1469
|
|
|
1485
1470
|
function mergeScanWithIndex_1(fa, initial, f, concurrent = Infinity) {
|
|
1486
|
-
return
|
|
1471
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1487
1472
|
let state = initial;
|
|
1488
1473
|
return mergeInternal(source, subscriber, (index, value) => f(index, state, value), concurrent, value => {
|
|
1489
1474
|
state = value;
|
|
@@ -1499,7 +1484,7 @@ export function mergeScan_(fa, initial, f, concurrent = Infinity) {
|
|
|
1499
1484
|
return mergeScanWithIndex_1(fa, initial, (_, b, a) => f(b, a), concurrent);
|
|
1500
1485
|
}
|
|
1501
1486
|
export function onErrorResumeNext(fa, ...sources) {
|
|
1502
|
-
return
|
|
1487
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1503
1488
|
const remaining = [source, ...sources];
|
|
1504
1489
|
|
|
1505
1490
|
const subscribeNext = () => {
|
|
@@ -1514,9 +1499,9 @@ export function onErrorResumeNext(fa, ...sources) {
|
|
|
1514
1499
|
return;
|
|
1515
1500
|
}
|
|
1516
1501
|
|
|
1517
|
-
const innerSub =
|
|
1518
|
-
error:
|
|
1519
|
-
complete:
|
|
1502
|
+
const innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1503
|
+
error: tsplus_module_2.noop,
|
|
1504
|
+
complete: tsplus_module_2.noop
|
|
1520
1505
|
});
|
|
1521
1506
|
subscriber.add(nextSource.subscribe(innerSub));
|
|
1522
1507
|
innerSub.add(subscribeNext);
|
|
@@ -1534,9 +1519,9 @@ export function onErrorResumeNext(fa, ...sources) {
|
|
|
1534
1519
|
*/
|
|
1535
1520
|
|
|
1536
1521
|
function onEmpty_1(fa, f) {
|
|
1537
|
-
return
|
|
1522
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1538
1523
|
let hasValue = false;
|
|
1539
|
-
source.subscribe(
|
|
1524
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1540
1525
|
next: value => {
|
|
1541
1526
|
hasValue = true;
|
|
1542
1527
|
subscriber.next(value);
|
|
@@ -1557,13 +1542,13 @@ function onEmpty_1(fa, f) {
|
|
|
1557
1542
|
|
|
1558
1543
|
|
|
1559
1544
|
export function repeat_(fa, count = Infinity) {
|
|
1560
|
-
return count <= 0 ? empty_1() :
|
|
1545
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1561
1546
|
let repeats = 0;
|
|
1562
1547
|
let innerSub;
|
|
1563
1548
|
|
|
1564
1549
|
const loop = () => {
|
|
1565
1550
|
let syncUnsub = false;
|
|
1566
|
-
innerSub = source.subscribe(
|
|
1551
|
+
innerSub = source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1567
1552
|
complete: () => {
|
|
1568
1553
|
if (++repeats < count) {
|
|
1569
1554
|
if (innerSub) {
|
|
@@ -1604,13 +1589,13 @@ export function retry_(fa, configOrCount = Infinity) {
|
|
|
1604
1589
|
count,
|
|
1605
1590
|
resetOnSuccess = false
|
|
1606
1591
|
} = config;
|
|
1607
|
-
return count <= 0 ? fa :
|
|
1592
|
+
return count <= 0 ? fa : tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1608
1593
|
let retries = 0;
|
|
1609
1594
|
let innerSub;
|
|
1610
1595
|
|
|
1611
1596
|
const loop = () => {
|
|
1612
1597
|
let syncUnsub = false;
|
|
1613
|
-
innerSub = source.subscribe(
|
|
1598
|
+
innerSub = source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1614
1599
|
next: value => {
|
|
1615
1600
|
if (resetOnSuccess) {
|
|
1616
1601
|
retries = 0;
|
|
@@ -1648,10 +1633,10 @@ export function retry_(fa, configOrCount = Infinity) {
|
|
|
1648
1633
|
*/
|
|
1649
1634
|
|
|
1650
1635
|
function sample_1(fa, notifier) {
|
|
1651
|
-
return
|
|
1636
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1652
1637
|
let hasValue = false;
|
|
1653
1638
|
let lastValue = null;
|
|
1654
|
-
source.subscribe(
|
|
1639
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1655
1640
|
next: value => {
|
|
1656
1641
|
hasValue = true;
|
|
1657
1642
|
lastValue = value;
|
|
@@ -1667,9 +1652,9 @@ function sample_1(fa, notifier) {
|
|
|
1667
1652
|
}
|
|
1668
1653
|
};
|
|
1669
1654
|
|
|
1670
|
-
notifier.subscribe(
|
|
1655
|
+
notifier.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1671
1656
|
next: emit,
|
|
1672
|
-
complete:
|
|
1657
|
+
complete: tsplus_module_2.noop
|
|
1673
1658
|
}));
|
|
1674
1659
|
});
|
|
1675
1660
|
}
|
|
@@ -1678,7 +1663,7 @@ function sample_1(fa, notifier) {
|
|
|
1678
1663
|
*/
|
|
1679
1664
|
|
|
1680
1665
|
|
|
1681
|
-
export function sampleTime_(fa, period, scheduler =
|
|
1666
|
+
export function sampleTime_(fa, period, scheduler = tsplus_module_5.asyncScheduler) {
|
|
1682
1667
|
return sample_1(fa, interval_1(period, scheduler));
|
|
1683
1668
|
}
|
|
1684
1669
|
/**
|
|
@@ -1686,7 +1671,7 @@ export function sampleTime_(fa, period, scheduler = tsplus_module_6.asyncSchedul
|
|
|
1686
1671
|
*/
|
|
1687
1672
|
|
|
1688
1673
|
function scanLeftWithIndex_1(fa, initial, f) {
|
|
1689
|
-
return
|
|
1674
|
+
return tsplus_module_8.operate_(fa, scanInternal(f, initial, true, true));
|
|
1690
1675
|
}
|
|
1691
1676
|
/**
|
|
1692
1677
|
* @tsplus fluent fncts.observable.Observable scanLeft
|
|
@@ -1696,10 +1681,38 @@ function scanLeftWithIndex_1(fa, initial, f) {
|
|
|
1696
1681
|
export function scanLeft(fa, initial, f) {
|
|
1697
1682
|
return scanLeftWithIndex_1(fa, initial, (_, b, a) => f(b, a));
|
|
1698
1683
|
}
|
|
1684
|
+
/**
|
|
1685
|
+
* @tsplus static fncts.observable.ObservableOps service
|
|
1686
|
+
*/
|
|
1687
|
+
|
|
1688
|
+
export function service(
|
|
1689
|
+
/** @tsplus auto */
|
|
1690
|
+
tag) {
|
|
1691
|
+
return serviceWithObservable_1(service => of_1(service), tag);
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* @tsplus static fncts.observable.ObservableOps serviceWith
|
|
1695
|
+
*/
|
|
1696
|
+
|
|
1697
|
+
export function serviceWith(f,
|
|
1698
|
+
/** @tsplus auto */
|
|
1699
|
+
tag) {
|
|
1700
|
+
return serviceWithObservable_1(service => of_1(f(service)), tag);
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* @tsplus static fncts.observable.ObservableOps serviceWithObservable
|
|
1704
|
+
*/
|
|
1705
|
+
|
|
1706
|
+
function serviceWithObservable_1(f,
|
|
1707
|
+
/** @tsplus auto */
|
|
1708
|
+
tag) {
|
|
1709
|
+
return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(environment, tag)));
|
|
1710
|
+
}
|
|
1699
1711
|
/**
|
|
1700
1712
|
* @tsplus fluent fncts.observable.Observable skip
|
|
1701
1713
|
*/
|
|
1702
1714
|
|
|
1715
|
+
|
|
1703
1716
|
export function skip_(fa, count) {
|
|
1704
1717
|
return filterWithIndex_1(fa, (index, _) => count <= index);
|
|
1705
1718
|
}
|
|
@@ -1708,10 +1721,10 @@ export function skip_(fa, count) {
|
|
|
1708
1721
|
*/
|
|
1709
1722
|
|
|
1710
1723
|
export function skipLast_(fa, skipCount) {
|
|
1711
|
-
return skipCount <= 0 ? fa :
|
|
1724
|
+
return skipCount <= 0 ? fa : tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1712
1725
|
let ring = new Array(skipCount);
|
|
1713
1726
|
let seen = 0;
|
|
1714
|
-
source.subscribe(
|
|
1727
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1715
1728
|
next: value => {
|
|
1716
1729
|
const valueIndex = seen++;
|
|
1717
1730
|
|
|
@@ -1735,17 +1748,17 @@ export function skipLast_(fa, skipCount) {
|
|
|
1735
1748
|
*/
|
|
1736
1749
|
|
|
1737
1750
|
export function skipUntil_(fa, notifier) {
|
|
1738
|
-
return
|
|
1751
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1739
1752
|
let taking = false;
|
|
1740
|
-
const skipSubscriber =
|
|
1753
|
+
const skipSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1741
1754
|
next: () => {
|
|
1742
1755
|
skipSubscriber?.unsubscribe();
|
|
1743
1756
|
taking = true;
|
|
1744
1757
|
},
|
|
1745
|
-
complete:
|
|
1758
|
+
complete: tsplus_module_2.noop
|
|
1746
1759
|
});
|
|
1747
1760
|
from_1(notifier).subscribe(skipSubscriber);
|
|
1748
|
-
source.subscribe(
|
|
1761
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1749
1762
|
next: value => taking && subscriber.next(value)
|
|
1750
1763
|
}));
|
|
1751
1764
|
});
|
|
@@ -1755,10 +1768,10 @@ export function skipUntil_(fa, notifier) {
|
|
|
1755
1768
|
*/
|
|
1756
1769
|
|
|
1757
1770
|
export function skipWhile_(fa, predicate) {
|
|
1758
|
-
return
|
|
1771
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1759
1772
|
let taking = false;
|
|
1760
1773
|
let index = 0;
|
|
1761
|
-
source.subscribe(
|
|
1774
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1762
1775
|
next: value => (taking || (taking = !predicate(index++, value))) && subscriber.next(value)
|
|
1763
1776
|
}));
|
|
1764
1777
|
});
|
|
@@ -1768,7 +1781,7 @@ export function skipWhile_(fa, predicate) {
|
|
|
1768
1781
|
*/
|
|
1769
1782
|
|
|
1770
1783
|
export function startWith_(fa, ...values) {
|
|
1771
|
-
return
|
|
1784
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1772
1785
|
// @ts-expect-error
|
|
1773
1786
|
concat_1(source, values).subscribe(subscriber);
|
|
1774
1787
|
});
|
|
@@ -1778,7 +1791,7 @@ export function startWith_(fa, ...values) {
|
|
|
1778
1791
|
*/
|
|
1779
1792
|
|
|
1780
1793
|
export function subscribeOn_(fa, scheduler, delay = 0) {
|
|
1781
|
-
return
|
|
1794
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1782
1795
|
subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
|
|
1783
1796
|
});
|
|
1784
1797
|
}
|
|
@@ -1794,18 +1807,18 @@ export function switchAll(ffa) {
|
|
|
1794
1807
|
*/
|
|
1795
1808
|
|
|
1796
1809
|
function switchMapWithIndex_1(fa, f) {
|
|
1797
|
-
return
|
|
1810
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1798
1811
|
let innerSubscriber = null;
|
|
1799
1812
|
let index = 0;
|
|
1800
1813
|
let isComplete = false;
|
|
1801
1814
|
|
|
1802
1815
|
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
|
|
1803
1816
|
|
|
1804
|
-
source.subscribe(
|
|
1817
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1805
1818
|
next: value => {
|
|
1806
1819
|
innerSubscriber?.unsubscribe();
|
|
1807
1820
|
const outerIndex = index++;
|
|
1808
|
-
from_1(f(outerIndex, value)).subscribe(innerSubscriber =
|
|
1821
|
+
from_1(f(outerIndex, value)).subscribe(innerSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1809
1822
|
next: innerValue => subscriber.next(innerValue),
|
|
1810
1823
|
complete: () => {
|
|
1811
1824
|
innerSubscriber = null;
|
|
@@ -1833,7 +1846,7 @@ function switchMap_1(fa, f) {
|
|
|
1833
1846
|
|
|
1834
1847
|
|
|
1835
1848
|
function switchScanWithIndex_1(fa, initial, f) {
|
|
1836
|
-
return
|
|
1849
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1837
1850
|
let state = initial;
|
|
1838
1851
|
switchMapWithIndex_1(source, (index, value) => map_1(from_1(f(index, state, value)), b => (state = b, b))).subscribe(subscriber);
|
|
1839
1852
|
return () => {
|
|
@@ -1854,9 +1867,9 @@ export function switchScan_(fa, initial, f) {
|
|
|
1854
1867
|
*/
|
|
1855
1868
|
|
|
1856
1869
|
function take_1(fa, count) {
|
|
1857
|
-
return count <= 0 ? empty_1() :
|
|
1870
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_(fa, (source, sub) => {
|
|
1858
1871
|
let seen = 0;
|
|
1859
|
-
source.subscribe(new
|
|
1872
|
+
source.subscribe(new tsplus_module_8.OperatorSubscriber(sub, {
|
|
1860
1873
|
next: value => {
|
|
1861
1874
|
if (++seen <= count) {
|
|
1862
1875
|
sub.next(value);
|
|
@@ -1875,9 +1888,9 @@ function take_1(fa, count) {
|
|
|
1875
1888
|
|
|
1876
1889
|
|
|
1877
1890
|
export function takeLast_(fa, count) {
|
|
1878
|
-
return count <= 0 ? empty_1() :
|
|
1891
|
+
return count <= 0 ? empty_1() : tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1879
1892
|
let buffer = [];
|
|
1880
|
-
source.subscribe(
|
|
1893
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1881
1894
|
next: value => {
|
|
1882
1895
|
buffer.push(value);
|
|
1883
1896
|
count < buffer.length && buffer.shift();
|
|
@@ -1899,19 +1912,19 @@ export function takeLast_(fa, count) {
|
|
|
1899
1912
|
*/
|
|
1900
1913
|
|
|
1901
1914
|
export function takeUntil_(fa, notifier) {
|
|
1902
|
-
return
|
|
1903
|
-
from_1(notifier).subscribe(
|
|
1915
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1916
|
+
from_1(notifier).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1904
1917
|
next: () => subscriber.complete(),
|
|
1905
|
-
complete:
|
|
1918
|
+
complete: tsplus_module_2.noop
|
|
1906
1919
|
}));
|
|
1907
1920
|
!subscriber.closed && source.subscribe(subscriber);
|
|
1908
1921
|
});
|
|
1909
1922
|
}
|
|
1910
1923
|
|
|
1911
1924
|
function takeWhileWithIndex_1(fa, predicate, inclusive) {
|
|
1912
|
-
return
|
|
1925
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1913
1926
|
let index = 0;
|
|
1914
|
-
source.subscribe(
|
|
1927
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1915
1928
|
next: value => {
|
|
1916
1929
|
const result = predicate(index++, value);
|
|
1917
1930
|
(result || inclusive) && subscriber.next(value);
|
|
@@ -1929,8 +1942,8 @@ export function takeWhile_(fa, predicate, inclusive) {
|
|
|
1929
1942
|
*/
|
|
1930
1943
|
|
|
1931
1944
|
export function tap_(fa, observer) {
|
|
1932
|
-
return
|
|
1933
|
-
source.subscribe(
|
|
1945
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1946
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1934
1947
|
next: value => {
|
|
1935
1948
|
observer.next?.(value);
|
|
1936
1949
|
subscriber.next(value);
|
|
@@ -1958,8 +1971,8 @@ function throttle_1(fa, durationSelector, {
|
|
|
1958
1971
|
leading,
|
|
1959
1972
|
trailing
|
|
1960
1973
|
} = defaultThrottleConfig) {
|
|
1961
|
-
return
|
|
1962
|
-
let sendValue =
|
|
1974
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
1975
|
+
let sendValue = tsplus_module_17.nothing();
|
|
1963
1976
|
let throttled = null;
|
|
1964
1977
|
let isComplete = false;
|
|
1965
1978
|
|
|
@@ -1978,30 +1991,30 @@ function throttle_1(fa, durationSelector, {
|
|
|
1978
1991
|
isComplete && subscriber.complete();
|
|
1979
1992
|
};
|
|
1980
1993
|
|
|
1981
|
-
const startThrottling = value => throttled = from_1(durationSelector(value)).subscribe(
|
|
1994
|
+
const startThrottling = value => throttled = from_1(durationSelector(value)).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1982
1995
|
next: endThrottling,
|
|
1983
1996
|
complete: cleanupThrottling
|
|
1984
1997
|
}));
|
|
1985
1998
|
|
|
1986
1999
|
const send = () => {
|
|
1987
|
-
if (
|
|
2000
|
+
if (tsplus_module_18.isJust(sendValue)) {
|
|
1988
2001
|
const {
|
|
1989
2002
|
value
|
|
1990
2003
|
} = sendValue;
|
|
1991
|
-
sendValue =
|
|
2004
|
+
sendValue = tsplus_module_17.nothing();
|
|
1992
2005
|
subscriber.next(value);
|
|
1993
2006
|
!isComplete && startThrottling(value);
|
|
1994
2007
|
}
|
|
1995
2008
|
};
|
|
1996
2009
|
|
|
1997
|
-
source.subscribe(
|
|
2010
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
1998
2011
|
next: value => {
|
|
1999
|
-
sendValue =
|
|
2012
|
+
sendValue = tsplus_module_17.just(value);
|
|
2000
2013
|
!(throttled && !throttled.closed) && (leading ? send() : startThrottling(value));
|
|
2001
2014
|
},
|
|
2002
2015
|
complete: () => {
|
|
2003
2016
|
isComplete = true;
|
|
2004
|
-
!(trailing &&
|
|
2017
|
+
!(trailing && tsplus_module_18.isJust(sendValue) && throttled && !throttled.closed) && subscriber.complete();
|
|
2005
2018
|
}
|
|
2006
2019
|
}));
|
|
2007
2020
|
});
|
|
@@ -2011,7 +2024,7 @@ function throttle_1(fa, durationSelector, {
|
|
|
2011
2024
|
*/
|
|
2012
2025
|
|
|
2013
2026
|
|
|
2014
|
-
export function throttleTime_(fa, duration, scheduler =
|
|
2027
|
+
export function throttleTime_(fa, duration, scheduler = tsplus_module_5.asyncScheduler, config = defaultThrottleConfig) {
|
|
2015
2028
|
const duration$ = timer_1(duration, scheduler);
|
|
2016
2029
|
return throttle_1(fa, () => duration$, config);
|
|
2017
2030
|
}
|
|
@@ -2028,14 +2041,14 @@ export function timeout_(fa, config) {
|
|
|
2028
2041
|
first,
|
|
2029
2042
|
each,
|
|
2030
2043
|
with: _with = timeoutError,
|
|
2031
|
-
scheduler =
|
|
2044
|
+
scheduler = tsplus_module_5.asyncScheduler,
|
|
2032
2045
|
meta = null
|
|
2033
2046
|
} = config;
|
|
2034
|
-
return
|
|
2047
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
2035
2048
|
// eslint-disable-next-line prefer-const
|
|
2036
2049
|
let originalSourceSubscription;
|
|
2037
2050
|
let timerSubscription;
|
|
2038
|
-
let lastValue =
|
|
2051
|
+
let lastValue = tsplus_module_17.nothing();
|
|
2039
2052
|
let seen = 0;
|
|
2040
2053
|
|
|
2041
2054
|
const startTimer = delay => {
|
|
@@ -2049,11 +2062,11 @@ export function timeout_(fa, config) {
|
|
|
2049
2062
|
}, delay);
|
|
2050
2063
|
};
|
|
2051
2064
|
|
|
2052
|
-
originalSourceSubscription = source.subscribe(
|
|
2065
|
+
originalSourceSubscription = source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2053
2066
|
next: value => {
|
|
2054
2067
|
timerSubscription?.unsubscribe();
|
|
2055
2068
|
seen++;
|
|
2056
|
-
lastValue =
|
|
2069
|
+
lastValue = tsplus_module_17.just(value);
|
|
2057
2070
|
subscriber.next(value);
|
|
2058
2071
|
each > 0 && startTimer(each);
|
|
2059
2072
|
}
|
|
@@ -2062,7 +2075,7 @@ export function timeout_(fa, config) {
|
|
|
2062
2075
|
timerSubscription?.unsubscribe();
|
|
2063
2076
|
}
|
|
2064
2077
|
|
|
2065
|
-
lastValue =
|
|
2078
|
+
lastValue = tsplus_module_17.nothing();
|
|
2066
2079
|
}));
|
|
2067
2080
|
startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
|
|
2068
2081
|
});
|
|
@@ -2081,7 +2094,7 @@ function toArrayAccumulator(arr, value) {
|
|
|
2081
2094
|
|
|
2082
2095
|
|
|
2083
2096
|
function toArray_1(fa) {
|
|
2084
|
-
return
|
|
2097
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
2085
2098
|
foldLeft_1(source, [], toArrayAccumulator).subscribe(subscriber);
|
|
2086
2099
|
});
|
|
2087
2100
|
}
|
|
@@ -2091,31 +2104,31 @@ function toArray_1(fa) {
|
|
|
2091
2104
|
|
|
2092
2105
|
|
|
2093
2106
|
export function unique_(fa, toKey, flushes) {
|
|
2094
|
-
return
|
|
2095
|
-
let distinctKeys =
|
|
2096
|
-
source.subscribe(
|
|
2107
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
2108
|
+
let distinctKeys = tsplus_module_21.makeDefault();
|
|
2109
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2097
2110
|
next: value => {
|
|
2098
2111
|
const key = toKey ? toKey(value) : value;
|
|
2099
2112
|
|
|
2100
|
-
if (!
|
|
2101
|
-
|
|
2113
|
+
if (!tsplus_module_21.has_(distinctKeys, key)) {
|
|
2114
|
+
tsplus_module_21.add_(distinctKeys, key);
|
|
2102
2115
|
subscriber.next(value);
|
|
2103
2116
|
}
|
|
2104
2117
|
}
|
|
2105
2118
|
}));
|
|
2106
|
-
flushes?.subscribe(
|
|
2107
|
-
next: () => distinctKeys =
|
|
2108
|
-
complete:
|
|
2119
|
+
flushes?.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2120
|
+
next: () => distinctKeys = tsplus_module_21.makeDefault(),
|
|
2121
|
+
complete: tsplus_module_2.noop
|
|
2109
2122
|
}));
|
|
2110
2123
|
});
|
|
2111
2124
|
}
|
|
2112
2125
|
|
|
2113
2126
|
function uniqueUntilChanged_1(fa, E, keySelector = tsplus_module_13.identity) {
|
|
2114
2127
|
const compare = "equals" in E ? E.equals : E;
|
|
2115
|
-
return
|
|
2128
|
+
return tsplus_module_8.operate_(fa, (source, subscriber) => {
|
|
2116
2129
|
let previousKey;
|
|
2117
2130
|
let first = true;
|
|
2118
|
-
source.subscribe(
|
|
2131
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2119
2132
|
next: value => {
|
|
2120
2133
|
const currentKey = keySelector(value);
|
|
2121
2134
|
|
|
@@ -2133,11 +2146,6 @@ export function uniqueUntilKeyChanged_(fa, key, equals) {
|
|
|
2133
2146
|
const compare = "equals" in equals ? equals.equals : equals;
|
|
2134
2147
|
return uniqueUntilChanged_1(fa, (x, y) => compare(x[key], y[key]));
|
|
2135
2148
|
}
|
|
2136
|
-
/*
|
|
2137
|
-
* -------------------------------------------------------------------------------------------------
|
|
2138
|
-
* internal
|
|
2139
|
-
* -------------------------------------------------------------------------------------------------
|
|
2140
|
-
*/
|
|
2141
2149
|
|
|
2142
2150
|
function combineLatestInternal(subscriber, observables, scheduler, valueTransform = tsplus_module_13.identity) {
|
|
2143
2151
|
return maybeSchedule(subscriber, scheduler, () => {
|
|
@@ -2152,7 +2160,7 @@ function combineLatestInternal(subscriber, observables, scheduler, valueTransfor
|
|
|
2152
2160
|
maybeSchedule(subscriber, scheduler, () => {
|
|
2153
2161
|
const source = scheduler ? scheduled_1(observables[i], scheduler) : from_1(observables[i]);
|
|
2154
2162
|
let hasFirstValue = false;
|
|
2155
|
-
source.subscribe(
|
|
2163
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2156
2164
|
next: value => {
|
|
2157
2165
|
values[i] = value;
|
|
2158
2166
|
|
|
@@ -2180,17 +2188,17 @@ function findInternal(predicate, emit) {
|
|
|
2180
2188
|
const findIndex = emit === "index";
|
|
2181
2189
|
return (source, subscriber) => {
|
|
2182
2190
|
let index = 0;
|
|
2183
|
-
source.subscribe(
|
|
2191
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2184
2192
|
next: value => {
|
|
2185
2193
|
const i = index++;
|
|
2186
2194
|
|
|
2187
2195
|
if (predicate(index++, value)) {
|
|
2188
|
-
subscriber.next(findIndex ? i :
|
|
2196
|
+
subscriber.next(findIndex ? i : tsplus_module_17.just(value));
|
|
2189
2197
|
subscriber.complete();
|
|
2190
2198
|
}
|
|
2191
2199
|
},
|
|
2192
2200
|
complete: () => {
|
|
2193
|
-
subscriber.next(findIndex ? -1 :
|
|
2201
|
+
subscriber.next(findIndex ? -1 : tsplus_module_17.nothing());
|
|
2194
2202
|
subscriber.complete();
|
|
2195
2203
|
}
|
|
2196
2204
|
}));
|
|
@@ -2227,7 +2235,7 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2227
2235
|
expand && subscriber.next(a);
|
|
2228
2236
|
active++;
|
|
2229
2237
|
let innerComplete = false;
|
|
2230
|
-
from_1(f(index++, a)).subscribe(new
|
|
2238
|
+
from_1(f(index++, a)).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2231
2239
|
next: b => {
|
|
2232
2240
|
onBeforeNext?.(b);
|
|
2233
2241
|
|
|
@@ -2252,13 +2260,13 @@ function mergeInternal(source, subscriber, f, concurrent, onBeforeNext, expand,
|
|
|
2252
2260
|
|
|
2253
2261
|
checkComplete();
|
|
2254
2262
|
} catch (err) {
|
|
2255
|
-
subscriber.error(
|
|
2263
|
+
subscriber.error(tsplus_module_1.halt(err));
|
|
2256
2264
|
}
|
|
2257
2265
|
}
|
|
2258
2266
|
}));
|
|
2259
2267
|
};
|
|
2260
2268
|
|
|
2261
|
-
source.subscribe(new
|
|
2269
|
+
source.subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
|
|
2262
2270
|
next: outerNext,
|
|
2263
2271
|
complete: () => {
|
|
2264
2272
|
isComplete = true;
|
|
@@ -2275,7 +2283,7 @@ export function scanInternal(f, initial, hasInitial, emitOnNext, emitBeforeCompl
|
|
|
2275
2283
|
let hasState = hasInitial;
|
|
2276
2284
|
let state = initial;
|
|
2277
2285
|
let index = 0;
|
|
2278
|
-
source.subscribe(
|
|
2286
|
+
source.subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
|
|
2279
2287
|
next: value => {
|
|
2280
2288
|
const i = index++;
|
|
2281
2289
|
state = hasState ? f(i, state, value) : (hasState = true, value);
|