@mastra/nestjs 0.1.8-alpha.0 → 0.1.8-alpha.2
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/CHANGELOG.md +16 -0
- package/dist/_types/rxjs/dist/types/index.d.ts +173 -0
- package/dist/_types/rxjs/dist/types/internal/AnyCatcher.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/AsyncSubject.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/BehaviorSubject.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/Notification.d.ts +180 -0
- package/dist/_types/rxjs/dist/types/internal/Observable.d.ts +128 -0
- package/dist/_types/rxjs/dist/types/internal/Operator.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/ReplaySubject.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/Scheduler.d.ts +55 -0
- package/dist/_types/rxjs/dist/types/internal/Subject.d.ts +58 -0
- package/dist/_types/rxjs/dist/types/internal/Subscriber.d.ts +78 -0
- package/dist/_types/rxjs/dist/types/internal/Subscription.d.ts +96 -0
- package/dist/_types/rxjs/dist/types/internal/config.d.ts +73 -0
- package/dist/_types/rxjs/dist/types/internal/firstValueFrom.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/lastValueFrom.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/observable/ConnectableObservable.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/observable/bindCallback.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/bindNodeCallback.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/combineLatest.d.ts +33 -0
- package/dist/_types/rxjs/dist/types/internal/observable/concat.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/connectable.d.ts +27 -0
- package/dist/_types/rxjs/dist/types/internal/observable/defer.d.ts +52 -0
- package/dist/_types/rxjs/dist/types/internal/observable/dom/animationFrames.d.ts +76 -0
- package/dist/_types/rxjs/dist/types/internal/observable/empty.d.ts +72 -0
- package/dist/_types/rxjs/dist/types/internal/observable/forkJoin.d.ts +24 -0
- package/dist/_types/rxjs/dist/types/internal/observable/from.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/observable/fromEvent.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/observable/fromEventPattern.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/generate.d.ts +311 -0
- package/dist/_types/rxjs/dist/types/internal/observable/iif.d.ts +82 -0
- package/dist/_types/rxjs/dist/types/internal/observable/interval.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/observable/merge.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/observable/never.d.ts +40 -0
- package/dist/_types/rxjs/dist/types/internal/observable/of.d.ts +14 -0
- package/dist/_types/rxjs/dist/types/internal/observable/onErrorResumeNext.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/pairs.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/observable/partition.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/observable/race.d.ts +12 -0
- package/dist/_types/rxjs/dist/types/internal/observable/range.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/observable/throwError.d.ts +115 -0
- package/dist/_types/rxjs/dist/types/internal/observable/timer.d.ts +126 -0
- package/dist/_types/rxjs/dist/types/internal/observable/using.d.ts +32 -0
- package/dist/_types/rxjs/dist/types/internal/observable/zip.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/audit.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/auditTime.d.ts +50 -0
- package/dist/_types/rxjs/dist/types/internal/operators/buffer.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferCount.d.ts +54 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferTime.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferToggle.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferWhen.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/operators/catchError.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineAll.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineLatestAll.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineLatestWith.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatAll.d.ts +59 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatMapTo.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatWith.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/connect.d.ts +87 -0
- package/dist/_types/rxjs/dist/types/internal/operators/count.d.ts +58 -0
- package/dist/_types/rxjs/dist/types/internal/operators/debounce.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/debounceTime.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/defaultIfEmpty.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/delay.d.ts +59 -0
- package/dist/_types/rxjs/dist/types/internal/operators/delayWhen.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/dematerialize.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinct.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinctUntilChanged.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinctUntilKeyChanged.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/elementAt.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/endWith.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/every.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaust.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaustAll.d.ts +47 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaustMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/expand.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/filter.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/finalize.d.ts +64 -0
- package/dist/_types/rxjs/dist/types/internal/operators/find.d.ts +12 -0
- package/dist/_types/rxjs/dist/types/internal/operators/findIndex.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/first.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/flatMap.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/groupBy.d.ts +119 -0
- package/dist/_types/rxjs/dist/types/internal/operators/ignoreElements.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/isEmpty.d.ts +64 -0
- package/dist/_types/rxjs/dist/types/internal/operators/last.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/map.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mapTo.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/operators/materialize.d.ts +52 -0
- package/dist/_types/rxjs/dist/types/internal/operators/max.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeAll.d.ts +62 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeMapTo.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeScan.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeWith.d.ts +44 -0
- package/dist/_types/rxjs/dist/types/internal/operators/min.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/operators/multicast.d.ts +63 -0
- package/dist/_types/rxjs/dist/types/internal/operators/observeOn.d.ts +56 -0
- package/dist/_types/rxjs/dist/types/internal/operators/onErrorResumeNextWith.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/pairwise.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/pluck.d.ts +18 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publish.d.ts +30 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishBehavior.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishLast.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishReplay.d.ts +56 -0
- package/dist/_types/rxjs/dist/types/internal/operators/raceWith.d.ts +29 -0
- package/dist/_types/rxjs/dist/types/internal/operators/reduce.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/refCount.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/repeat.d.ts +108 -0
- package/dist/_types/rxjs/dist/types/internal/operators/repeatWhen.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/retry.d.ts +28 -0
- package/dist/_types/rxjs/dist/types/internal/operators/retryWhen.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sample.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sampleTime.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/scan.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sequenceEqual.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/share.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/shareReplay.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/operators/single.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skip.d.ts +36 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipLast.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipUntil.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipWhile.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/startWith.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/subscribeOn.d.ts +62 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchAll.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchMapTo.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchScan.d.ts +20 -0
- package/dist/_types/rxjs/dist/types/internal/operators/take.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeLast.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeUntil.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeWhile.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/tap.d.ts +72 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throttle.d.ts +78 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throttleTime.d.ts +53 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throwIfEmpty.d.ts +39 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeInterval.d.ts +50 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeout.d.ts +257 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeoutWith.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timestamp.d.ts +35 -0
- package/dist/_types/rxjs/dist/types/internal/operators/toArray.d.ts +33 -0
- package/dist/_types/rxjs/dist/types/internal/operators/window.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowCount.d.ts +66 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowTime.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowToggle.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowWhen.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/withLatestFrom.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/zipAll.d.ts +14 -0
- package/dist/_types/rxjs/dist/types/internal/operators/zipWith.d.ts +26 -0
- package/dist/_types/rxjs/dist/types/internal/scheduled/scheduled.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/Action.d.ts +32 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AnimationFrameScheduler.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsapScheduler.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsyncAction.d.ts +25 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsyncScheduler.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/QueueScheduler.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/VirtualTimeScheduler.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/animationFrame.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/asap.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/async.d.ts +53 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/queue.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/timerHandle.d.ts +2 -0
- package/dist/_types/rxjs/dist/types/internal/symbol/observable.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/types.d.ts +301 -0
- package/dist/_types/rxjs/dist/types/internal/util/ArgumentOutOfRangeError.d.ts +21 -0
- package/dist/_types/rxjs/dist/types/internal/util/EmptyError.d.ts +23 -0
- package/dist/_types/rxjs/dist/types/internal/util/NotFoundError.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/util/ObjectUnsubscribedError.d.ts +20 -0
- package/dist/_types/rxjs/dist/types/internal/util/SequenceError.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/util/UnsubscriptionError.d.ts +16 -0
- package/dist/_types/rxjs/dist/types/internal/util/identity.d.ts +44 -0
- package/dist/_types/rxjs/dist/types/internal/util/isObservable.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/util/noop.d.ts +2 -0
- package/dist/_types/rxjs/dist/types/internal/util/pipe.d.ts +14 -0
- package/dist/index.cjs +3 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -226
- package/dist/index.js.map +1 -1
- package/dist/interceptors/request-tracking.interceptor.d.ts +1 -1
- package/dist/interceptors/streaming.interceptor.d.ts +1 -1
- package/dist/interceptors/tracing.interceptor.d.ts +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a higher-order Observable into a first-order Observable which
|
|
4
|
+
* concurrently delivers all values that are emitted on the inner Observables.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Flattens an Observable-of-Observables.</span>
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* `mergeAll` subscribes to an Observable that emits Observables, also known as
|
|
11
|
+
* a higher-order Observable. Each time it observes one of these emitted inner
|
|
12
|
+
* Observables, it subscribes to that and delivers all the values from the
|
|
13
|
+
* inner Observable on the output Observable. The output Observable only
|
|
14
|
+
* completes once all inner Observables have completed. Any error delivered by
|
|
15
|
+
* a inner Observable will be immediately emitted on the output Observable.
|
|
16
|
+
*
|
|
17
|
+
* ## Examples
|
|
18
|
+
*
|
|
19
|
+
* Spawn a new interval Observable for each click event, and blend their outputs as one Observable
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { fromEvent, map, interval, mergeAll } from 'rxjs';
|
|
23
|
+
*
|
|
24
|
+
* const clicks = fromEvent(document, 'click');
|
|
25
|
+
* const higherOrder = clicks.pipe(map(() => interval(1000)));
|
|
26
|
+
* const firstOrder = higherOrder.pipe(mergeAll());
|
|
27
|
+
*
|
|
28
|
+
* firstOrder.subscribe(x => console.log(x));
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Count from 0 to 9 every second for each click, but only allow 2 concurrent timers
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { fromEvent, map, interval, take, mergeAll } from 'rxjs';
|
|
35
|
+
*
|
|
36
|
+
* const clicks = fromEvent(document, 'click');
|
|
37
|
+
* const higherOrder = clicks.pipe(
|
|
38
|
+
* map(() => interval(1000).pipe(take(10)))
|
|
39
|
+
* );
|
|
40
|
+
* const firstOrder = higherOrder.pipe(mergeAll(2));
|
|
41
|
+
*
|
|
42
|
+
* firstOrder.subscribe(x => console.log(x));
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link combineLatestAll}
|
|
46
|
+
* @see {@link concatAll}
|
|
47
|
+
* @see {@link exhaustAll}
|
|
48
|
+
* @see {@link merge}
|
|
49
|
+
* @see {@link mergeMap}
|
|
50
|
+
* @see {@link mergeMapTo}
|
|
51
|
+
* @see {@link mergeScan}
|
|
52
|
+
* @see {@link switchAll}
|
|
53
|
+
* @see {@link switchMap}
|
|
54
|
+
* @see {@link zipAll}
|
|
55
|
+
*
|
|
56
|
+
* @param {number} [concurrent=Infinity] Maximum number of inner
|
|
57
|
+
* Observables being subscribed to concurrently.
|
|
58
|
+
* @return A function that returns an Observable that emits values coming from
|
|
59
|
+
* all the inner Observables emitted by the source Observable.
|
|
60
|
+
*/
|
|
61
|
+
export declare function mergeAll<O extends ObservableInput<any>>(concurrent?: number): OperatorFunction<O, ObservedValueOf<O>>;
|
|
62
|
+
//# sourceMappingURL=mergeAll.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
export declare function mergeMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, concurrent?: number): OperatorFunction<T, ObservedValueOf<O>>;
|
|
3
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
4
|
+
export declare function mergeMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined, concurrent?: number): OperatorFunction<T, ObservedValueOf<O>>;
|
|
5
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
6
|
+
export declare function mergeMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction<T, R>;
|
|
7
|
+
//# sourceMappingURL=mergeMap.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OperatorFunction, ObservedValueOf, ObservableInput } from '../types';
|
|
2
|
+
/** @deprecated Will be removed in v9. Use {@link mergeMap} instead: `mergeMap(() => result)` */
|
|
3
|
+
export declare function mergeMapTo<O extends ObservableInput<unknown>>(innerObservable: O, concurrent?: number): OperatorFunction<unknown, ObservedValueOf<O>>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead.
|
|
6
|
+
* Details: https://rxjs.dev/deprecations/resultSelector
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeMapTo<T, R, O extends ObservableInput<unknown>>(innerObservable: O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction<T, R>;
|
|
9
|
+
//# sourceMappingURL=mergeMapTo.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Applies an accumulator function over the source Observable where the
|
|
4
|
+
* accumulator function itself returns an Observable, then each intermediate
|
|
5
|
+
* Observable returned is merged into the output Observable.
|
|
6
|
+
*
|
|
7
|
+
* <span class="informal">It's like {@link scan}, but the Observables returned
|
|
8
|
+
* by the accumulator are merged into the outer Observable.</span>
|
|
9
|
+
*
|
|
10
|
+
* The first parameter of the `mergeScan` is an `accumulator` function which is
|
|
11
|
+
* being called every time the source Observable emits a value. `mergeScan` will
|
|
12
|
+
* subscribe to the value returned by the `accumulator` function and will emit
|
|
13
|
+
* values to the subscriber emitted by inner Observable.
|
|
14
|
+
*
|
|
15
|
+
* The `accumulator` function is being called with three parameters passed to it:
|
|
16
|
+
* `acc`, `value` and `index`. The `acc` parameter is used as the state parameter
|
|
17
|
+
* whose value is initially set to the `seed` parameter (the second parameter
|
|
18
|
+
* passed to the `mergeScan` operator).
|
|
19
|
+
*
|
|
20
|
+
* `mergeScan` internally keeps the value of the `acc` parameter: as long as the
|
|
21
|
+
* source Observable emits without inner Observable emitting, the `acc` will be
|
|
22
|
+
* set to `seed`. The next time the inner Observable emits a value, `mergeScan`
|
|
23
|
+
* will internally remember it and it will be passed to the `accumulator`
|
|
24
|
+
* function as `acc` parameter the next time source emits.
|
|
25
|
+
*
|
|
26
|
+
* The `value` parameter of the `accumulator` function is the value emitted by the
|
|
27
|
+
* source Observable, while the `index` is a number which represent the order of the
|
|
28
|
+
* current emission by the source Observable. It starts with 0.
|
|
29
|
+
*
|
|
30
|
+
* The last parameter to the `mergeScan` is the `concurrent` value which defaults
|
|
31
|
+
* to Infinity. It represents the maximum number of inner Observable subscriptions
|
|
32
|
+
* at a time.
|
|
33
|
+
*
|
|
34
|
+
* ## Example
|
|
35
|
+
*
|
|
36
|
+
* Count the number of click events
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { fromEvent, map, mergeScan, of } from 'rxjs';
|
|
40
|
+
*
|
|
41
|
+
* const click$ = fromEvent(document, 'click');
|
|
42
|
+
* const one$ = click$.pipe(map(() => 1));
|
|
43
|
+
* const seed = 0;
|
|
44
|
+
* const count$ = one$.pipe(
|
|
45
|
+
* mergeScan((acc, one) => of(acc + one), seed)
|
|
46
|
+
* );
|
|
47
|
+
*
|
|
48
|
+
* count$.subscribe(x => console.log(x));
|
|
49
|
+
*
|
|
50
|
+
* // Results:
|
|
51
|
+
* // 1
|
|
52
|
+
* // 2
|
|
53
|
+
* // 3
|
|
54
|
+
* // 4
|
|
55
|
+
* // ...and so on for each click
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @see {@link scan}
|
|
59
|
+
* @see {@link switchScan}
|
|
60
|
+
*
|
|
61
|
+
* @param {function(acc: R, value: T): Observable<R>} accumulator
|
|
62
|
+
* The accumulator function called on each source value.
|
|
63
|
+
* @param seed The initial accumulation value.
|
|
64
|
+
* @param {number} [concurrent=Infinity] Maximum number of
|
|
65
|
+
* input Observables being subscribed to concurrently.
|
|
66
|
+
* @return A function that returns an Observable of the accumulated values.
|
|
67
|
+
*/
|
|
68
|
+
export declare function mergeScan<T, R>(accumulator: (acc: R, value: T, index: number) => ObservableInput<R>, seed: R, concurrent?: number): OperatorFunction<T, R>;
|
|
69
|
+
//# sourceMappingURL=mergeScan.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ObservableInputTuple, OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Merge the values from all observables to a single observable result.
|
|
4
|
+
*
|
|
5
|
+
* Creates an observable, that when subscribed to, subscribes to the source
|
|
6
|
+
* observable, and all other sources provided as arguments. All values from
|
|
7
|
+
* every source are emitted from the resulting subscription.
|
|
8
|
+
*
|
|
9
|
+
* When all sources complete, the resulting observable will complete.
|
|
10
|
+
*
|
|
11
|
+
* When any source errors, the resulting observable will error.
|
|
12
|
+
*
|
|
13
|
+
* ## Example
|
|
14
|
+
*
|
|
15
|
+
* Joining all outputs from multiple user input event streams
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { fromEvent, map, mergeWith } from 'rxjs';
|
|
19
|
+
*
|
|
20
|
+
* const clicks$ = fromEvent(document, 'click').pipe(map(() => 'click'));
|
|
21
|
+
* const mousemoves$ = fromEvent(document, 'mousemove').pipe(map(() => 'mousemove'));
|
|
22
|
+
* const dblclicks$ = fromEvent(document, 'dblclick').pipe(map(() => 'dblclick'));
|
|
23
|
+
*
|
|
24
|
+
* mousemoves$
|
|
25
|
+
* .pipe(mergeWith(clicks$, dblclicks$))
|
|
26
|
+
* .subscribe(x => console.log(x));
|
|
27
|
+
*
|
|
28
|
+
* // result (assuming user interactions)
|
|
29
|
+
* // 'mousemove'
|
|
30
|
+
* // 'mousemove'
|
|
31
|
+
* // 'mousemove'
|
|
32
|
+
* // 'click'
|
|
33
|
+
* // 'click'
|
|
34
|
+
* // 'dblclick'
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see {@link merge}
|
|
38
|
+
*
|
|
39
|
+
* @param otherSources the sources to combine the current source with.
|
|
40
|
+
* @return A function that returns an Observable that merges the values from
|
|
41
|
+
* all given Observables.
|
|
42
|
+
*/
|
|
43
|
+
export declare function mergeWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
|
44
|
+
//# sourceMappingURL=mergeWith.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
|
|
4
|
+
* and when source Observable completes it emits a single item: the item with the smallest value.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* ## Examples
|
|
9
|
+
*
|
|
10
|
+
* Get the minimal value of a series of numbers
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { of, min } from 'rxjs';
|
|
14
|
+
*
|
|
15
|
+
* of(5, 4, 7, 2, 8)
|
|
16
|
+
* .pipe(min())
|
|
17
|
+
* .subscribe(x => console.log(x));
|
|
18
|
+
*
|
|
19
|
+
* // Outputs
|
|
20
|
+
* // 2
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Use a comparer function to get the minimal item
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { of, min } from 'rxjs';
|
|
27
|
+
*
|
|
28
|
+
* of(
|
|
29
|
+
* { age: 7, name: 'Foo' },
|
|
30
|
+
* { age: 5, name: 'Bar' },
|
|
31
|
+
* { age: 9, name: 'Beer' }
|
|
32
|
+
* ).pipe(
|
|
33
|
+
* min((a, b) => a.age < b.age ? -1 : 1)
|
|
34
|
+
* )
|
|
35
|
+
* .subscribe(x => console.log(x.name));
|
|
36
|
+
*
|
|
37
|
+
* // Outputs
|
|
38
|
+
* // 'Bar'
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link max}
|
|
42
|
+
*
|
|
43
|
+
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
|
|
44
|
+
* value of two items.
|
|
45
|
+
* @return A function that returns an Observable that emits item with the
|
|
46
|
+
* smallest value.
|
|
47
|
+
*/
|
|
48
|
+
export declare function min<T>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction<T>;
|
|
49
|
+
//# sourceMappingURL=min.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Subject } from '../Subject';
|
|
2
|
+
import { Observable } from '../Observable';
|
|
3
|
+
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
|
4
|
+
import { OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
|
7
|
+
* with the `connect` method, will use the provided subject to multicast the values
|
|
8
|
+
* from the source to all consumers.
|
|
9
|
+
*
|
|
10
|
+
* @param subject The subject to multicast through.
|
|
11
|
+
* @return A function that returns a {@link ConnectableObservable}
|
|
12
|
+
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
|
13
|
+
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
|
14
|
+
* `multicast(subject), refCount()` is equivalent to
|
|
15
|
+
* `share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
|
|
16
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
17
|
+
*/
|
|
18
|
+
export declare function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
|
21
|
+
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
|
22
|
+
* {@link connect} operator.
|
|
23
|
+
*
|
|
24
|
+
* @param subject The subject used to multicast.
|
|
25
|
+
* @param selector A setup function to setup the multicast
|
|
26
|
+
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
|
27
|
+
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
|
28
|
+
* `multicast(subject, selector)` is equivalent to
|
|
29
|
+
* `connect(selector, { connector: () => subject })`.
|
|
30
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
31
|
+
*/
|
|
32
|
+
export declare function multicast<T, O extends ObservableInput<any>>(subject: Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
|
33
|
+
/**
|
|
34
|
+
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
|
35
|
+
* with the `connect` method, will use the provided subject to multicast the values
|
|
36
|
+
* from the source to all consumers.
|
|
37
|
+
*
|
|
38
|
+
* @param subjectFactory A factory that will be called to create the subject. Passing a function here
|
|
39
|
+
* will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of
|
|
40
|
+
* the source.
|
|
41
|
+
* @return A function that returns a {@link ConnectableObservable}
|
|
42
|
+
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
|
43
|
+
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
|
44
|
+
* `multicast(() => new BehaviorSubject('test')), refCount()` is equivalent to
|
|
45
|
+
* `share({ connector: () => new BehaviorSubject('test') })`.
|
|
46
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
47
|
+
*/
|
|
48
|
+
export declare function multicast<T>(subjectFactory: () => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
|
49
|
+
/**
|
|
50
|
+
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
|
51
|
+
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
|
52
|
+
* {@link connect} operator.
|
|
53
|
+
*
|
|
54
|
+
* @param subjectFactory A factory that creates the subject used to multicast.
|
|
55
|
+
* @param selector A function to setup the multicast and select the output.
|
|
56
|
+
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
|
57
|
+
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
|
58
|
+
* `multicast(subjectFactory, selector)` is equivalent to
|
|
59
|
+
* `connect(selector, { connector: subjectFactory })`.
|
|
60
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
61
|
+
*/
|
|
62
|
+
export declare function multicast<T, O extends ObservableInput<any>>(subjectFactory: () => Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
|
63
|
+
//# sourceMappingURL=multicast.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** @prettier */
|
|
2
|
+
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Re-emits all notifications from source Observable with specified scheduler.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Ensure a specific scheduler is used, from outside of an Observable.</span>
|
|
7
|
+
*
|
|
8
|
+
* `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule
|
|
9
|
+
* notifications emitted by the source Observable. It might be useful, if you do not have control over
|
|
10
|
+
* internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.
|
|
11
|
+
*
|
|
12
|
+
* Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,
|
|
13
|
+
* but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal
|
|
14
|
+
* scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits
|
|
15
|
+
* notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.
|
|
16
|
+
* An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split
|
|
17
|
+
* that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source
|
|
18
|
+
* Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a
|
|
19
|
+
* little bit more, to ensure that they are emitted at expected moments.
|
|
20
|
+
*
|
|
21
|
+
* As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications
|
|
22
|
+
* will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`
|
|
23
|
+
* will delay all notifications - including error notifications - while `delay` will pass through error
|
|
24
|
+
* from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator
|
|
25
|
+
* for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used
|
|
26
|
+
* for notification emissions in general.
|
|
27
|
+
*
|
|
28
|
+
* ## Example
|
|
29
|
+
*
|
|
30
|
+
* Ensure values in subscribe are called just before browser repaint
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { interval, observeOn, animationFrameScheduler } from 'rxjs';
|
|
34
|
+
*
|
|
35
|
+
* const someDiv = document.createElement('div');
|
|
36
|
+
* someDiv.style.cssText = 'width: 200px;background: #09c';
|
|
37
|
+
* document.body.appendChild(someDiv);
|
|
38
|
+
* const intervals = interval(10); // Intervals are scheduled
|
|
39
|
+
* // with async scheduler by default...
|
|
40
|
+
* intervals.pipe(
|
|
41
|
+
* observeOn(animationFrameScheduler) // ...but we will observe on animationFrame
|
|
42
|
+
* ) // scheduler to ensure smooth animation.
|
|
43
|
+
* .subscribe(val => {
|
|
44
|
+
* someDiv.style.height = val + 'px';
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @see {@link delay}
|
|
49
|
+
*
|
|
50
|
+
* @param scheduler Scheduler that will be used to reschedule notifications from source Observable.
|
|
51
|
+
* @param delay Number of milliseconds that states with what delay every notification should be rescheduled.
|
|
52
|
+
* @return A function that returns an Observable that emits the same
|
|
53
|
+
* notifications as the source Observable, but with provided scheduler.
|
|
54
|
+
*/
|
|
55
|
+
export declare function observeOn<T>(scheduler: SchedulerLike, delay?: number): MonoTypeOperatorFunction<T>;
|
|
56
|
+
//# sourceMappingURL=observeOn.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObservableInputTuple, OperatorFunction } from '../types';
|
|
2
|
+
export declare function onErrorResumeNextWith<T, A extends readonly unknown[]>(sources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
|
3
|
+
export declare function onErrorResumeNextWith<T, A extends readonly unknown[]>(...sources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Renamed. Use {@link onErrorResumeNextWith} instead. Will be removed in v8.
|
|
6
|
+
*/
|
|
7
|
+
export declare const onErrorResumeNext: typeof onErrorResumeNextWith;
|
|
8
|
+
//# sourceMappingURL=onErrorResumeNextWith.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Groups pairs of consecutive emissions together and emits them as an array of
|
|
4
|
+
* two values.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Puts the current value and previous value together as
|
|
7
|
+
* an array, and emits that.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* The Nth emission from the source Observable will cause the output Observable
|
|
12
|
+
* to emit an array [(N-1)th, Nth] of the previous and the current value, as a
|
|
13
|
+
* pair. For this reason, `pairwise` emits on the second and subsequent
|
|
14
|
+
* emissions from the source Observable, but not on the first emission, because
|
|
15
|
+
* there is no previous value in that case.
|
|
16
|
+
*
|
|
17
|
+
* ## Example
|
|
18
|
+
*
|
|
19
|
+
* On every click (starting from the second), emit the relative distance to the previous click
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { fromEvent, pairwise, map } from 'rxjs';
|
|
23
|
+
*
|
|
24
|
+
* const clicks = fromEvent<PointerEvent>(document, 'click');
|
|
25
|
+
* const pairs = clicks.pipe(pairwise());
|
|
26
|
+
* const distance = pairs.pipe(
|
|
27
|
+
* map(([first, second]) => {
|
|
28
|
+
* const x0 = first.clientX;
|
|
29
|
+
* const y0 = first.clientY;
|
|
30
|
+
* const x1 = second.clientX;
|
|
31
|
+
* const y1 = second.clientY;
|
|
32
|
+
* return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));
|
|
33
|
+
* })
|
|
34
|
+
* );
|
|
35
|
+
*
|
|
36
|
+
* distance.subscribe(x => console.log(x));
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @see {@link buffer}
|
|
40
|
+
* @see {@link bufferCount}
|
|
41
|
+
*
|
|
42
|
+
* @return A function that returns an Observable of pairs (as arrays) of
|
|
43
|
+
* consecutive values from the source Observable.
|
|
44
|
+
*/
|
|
45
|
+
export declare function pairwise<T>(): OperatorFunction<T, [T, T]>;
|
|
46
|
+
//# sourceMappingURL=pairwise.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
3
|
+
export declare function pluck<T, K1 extends keyof T>(k1: K1): OperatorFunction<T, T[K1]>;
|
|
4
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
5
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1]>(k1: K1, k2: K2): OperatorFunction<T, T[K1][K2]>;
|
|
6
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
7
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(k1: K1, k2: K2, k3: K3): OperatorFunction<T, T[K1][K2][K3]>;
|
|
8
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
9
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(k1: K1, k2: K2, k3: K3, k4: K4): OperatorFunction<T, T[K1][K2][K3][K4]>;
|
|
10
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
11
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5): OperatorFunction<T, T[K1][K2][K3][K4][K5]>;
|
|
12
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
13
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4], K6 extends keyof T[K1][K2][K3][K4][K5]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6): OperatorFunction<T, T[K1][K2][K3][K4][K5][K6]>;
|
|
14
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
15
|
+
export declare function pluck<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], K5 extends keyof T[K1][K2][K3][K4], K6 extends keyof T[K1][K2][K3][K4][K5]>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6, ...rest: string[]): OperatorFunction<T, unknown>;
|
|
16
|
+
/** @deprecated Use {@link map} and optional chaining: `pluck('foo', 'bar')` is `map(x => x?.foo?.bar)`. Will be removed in v8. */
|
|
17
|
+
export declare function pluck<T>(...properties: string[]): OperatorFunction<T, unknown>;
|
|
18
|
+
//# sourceMappingURL=pluck.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
|
3
|
+
import { OperatorFunction, UnaryFunction, ObservableInput, ObservedValueOf } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a connectable observable that, when connected, will multicast
|
|
6
|
+
* all values through a single underlying {@link Subject} instance.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
|
9
|
+
* `source.pipe(publish())` is equivalent to
|
|
10
|
+
* `connectable(source, { connector: () => new Subject(), resetOnDisconnect: false })`.
|
|
11
|
+
* If you're using {@link refCount} after `publish`, use {@link share} operator instead.
|
|
12
|
+
* `source.pipe(publish(), refCount())` is equivalent to
|
|
13
|
+
* `source.pipe(share({ resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
|
|
14
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
15
|
+
*/
|
|
16
|
+
export declare function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns an observable, that when subscribed to, creates an underlying {@link Subject},
|
|
19
|
+
* provides an observable view of it to a `selector` function, takes the observable result of
|
|
20
|
+
* that selector function and subscribes to it, sending its values to the consumer, _then_ connects
|
|
21
|
+
* the subject to the original source.
|
|
22
|
+
*
|
|
23
|
+
* @param selector A function used to setup multicasting prior to automatic connection.
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
|
26
|
+
* `publish(selector)` is equivalent to `connect(selector)`.
|
|
27
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
28
|
+
*/
|
|
29
|
+
export declare function publish<T, O extends ObservableInput<any>>(selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
|
30
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
|
3
|
+
import { UnaryFunction } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a {@link ConnectableObservable} that utilizes a {@link BehaviorSubject}.
|
|
6
|
+
*
|
|
7
|
+
* @param initialValue The initial value passed to the {@link BehaviorSubject}.
|
|
8
|
+
* @return A function that returns a {@link ConnectableObservable}
|
|
9
|
+
* @deprecated Will be removed in v8. To create a connectable observable that uses a
|
|
10
|
+
* {@link BehaviorSubject} under the hood, use {@link connectable}.
|
|
11
|
+
* `source.pipe(publishBehavior(initValue))` is equivalent to
|
|
12
|
+
* `connectable(source, { connector: () => new BehaviorSubject(initValue), resetOnDisconnect: false })`.
|
|
13
|
+
* If you're using {@link refCount} after `publishBehavior`, use the {@link share} operator instead.
|
|
14
|
+
* `source.pipe(publishBehavior(initValue), refCount())` is equivalent to
|
|
15
|
+
* `source.pipe(share({ connector: () => new BehaviorSubject(initValue), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
|
|
16
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
17
|
+
*/
|
|
18
|
+
export declare function publishBehavior<T>(initialValue: T): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
|
19
|
+
//# sourceMappingURL=publishBehavior.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
|
3
|
+
import { UnaryFunction } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a connectable observable sequence that shares a single subscription to the
|
|
6
|
+
* underlying sequence containing only the last notification.
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* Similar to {@link publish}, but it waits until the source observable completes and stores
|
|
11
|
+
* the last emitted value.
|
|
12
|
+
* Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last
|
|
13
|
+
* value even if it has no more subscribers. If subsequent subscriptions happen, they will
|
|
14
|
+
* immediately get that last stored value and complete.
|
|
15
|
+
*
|
|
16
|
+
* ## Example
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { ConnectableObservable, interval, publishLast, tap, take } from 'rxjs';
|
|
20
|
+
*
|
|
21
|
+
* const connectable = <ConnectableObservable<number>>interval(1000)
|
|
22
|
+
* .pipe(
|
|
23
|
+
* tap(x => console.log('side effect', x)),
|
|
24
|
+
* take(3),
|
|
25
|
+
* publishLast()
|
|
26
|
+
* );
|
|
27
|
+
*
|
|
28
|
+
* connectable.subscribe({
|
|
29
|
+
* next: x => console.log('Sub. A', x),
|
|
30
|
+
* error: err => console.log('Sub. A Error', err),
|
|
31
|
+
* complete: () => console.log('Sub. A Complete')
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* connectable.subscribe({
|
|
35
|
+
* next: x => console.log('Sub. B', x),
|
|
36
|
+
* error: err => console.log('Sub. B Error', err),
|
|
37
|
+
* complete: () => console.log('Sub. B Complete')
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* connectable.connect();
|
|
41
|
+
*
|
|
42
|
+
* // Results:
|
|
43
|
+
* // 'side effect 0' - after one second
|
|
44
|
+
* // 'side effect 1' - after two seconds
|
|
45
|
+
* // 'side effect 2' - after three seconds
|
|
46
|
+
* // 'Sub. A 2' - immediately after 'side effect 2'
|
|
47
|
+
* // 'Sub. B 2'
|
|
48
|
+
* // 'Sub. A Complete'
|
|
49
|
+
* // 'Sub. B Complete'
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link ConnectableObservable}
|
|
53
|
+
* @see {@link publish}
|
|
54
|
+
* @see {@link publishReplay}
|
|
55
|
+
* @see {@link publishBehavior}
|
|
56
|
+
*
|
|
57
|
+
* @return A function that returns an Observable that emits elements of a
|
|
58
|
+
* sequence produced by multicasting the source sequence.
|
|
59
|
+
* @deprecated Will be removed in v8. To create a connectable observable with an
|
|
60
|
+
* {@link AsyncSubject} under the hood, use {@link connectable}.
|
|
61
|
+
* `source.pipe(publishLast())` is equivalent to
|
|
62
|
+
* `connectable(source, { connector: () => new AsyncSubject(), resetOnDisconnect: false })`.
|
|
63
|
+
* If you're using {@link refCount} after `publishLast`, use the {@link share} operator instead.
|
|
64
|
+
* `source.pipe(publishLast(), refCount())` is equivalent to
|
|
65
|
+
* `source.pipe(share({ connector: () => new AsyncSubject(), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
|
|
66
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
67
|
+
*/
|
|
68
|
+
export declare function publishLast<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
|
69
|
+
//# sourceMappingURL=publishLast.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { MonoTypeOperatorFunction, OperatorFunction, TimestampProvider, ObservableInput, ObservedValueOf } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a {@link ConnectableObservable} that uses a {@link ReplaySubject}
|
|
5
|
+
* internally.
|
|
6
|
+
*
|
|
7
|
+
* @param bufferSize The buffer size for the underlying {@link ReplaySubject}.
|
|
8
|
+
* @param windowTime The window time for the underlying {@link ReplaySubject}.
|
|
9
|
+
* @param timestampProvider The timestamp provider for the underlying {@link ReplaySubject}.
|
|
10
|
+
* @deprecated Will be removed in v8. To create a connectable observable that uses a
|
|
11
|
+
* {@link ReplaySubject} under the hood, use {@link connectable}.
|
|
12
|
+
* `source.pipe(publishReplay(size, time, scheduler))` is equivalent to
|
|
13
|
+
* `connectable(source, { connector: () => new ReplaySubject(size, time, scheduler), resetOnDisconnect: false })`.
|
|
14
|
+
* If you're using {@link refCount} after `publishReplay`, use the {@link share} operator instead.
|
|
15
|
+
* `publishReplay(size, time, scheduler), refCount()` is equivalent to
|
|
16
|
+
* `share({ connector: () => new ReplaySubject(size, time, scheduler), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
|
|
17
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
18
|
+
*/
|
|
19
|
+
export declare function publishReplay<T>(bufferSize?: number, windowTime?: number, timestampProvider?: TimestampProvider): MonoTypeOperatorFunction<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an observable, that when subscribed to, will create a {@link ReplaySubject},
|
|
22
|
+
* and pass an observable from it (using [asObservable](api/index/class/Subject#asObservable)) to
|
|
23
|
+
* the `selector` function, which then returns an observable that is subscribed to before
|
|
24
|
+
* "connecting" the source to the internal `ReplaySubject`.
|
|
25
|
+
*
|
|
26
|
+
* Since this is deprecated, for additional details see the documentation for {@link connect}.
|
|
27
|
+
*
|
|
28
|
+
* @param bufferSize The buffer size for the underlying {@link ReplaySubject}.
|
|
29
|
+
* @param windowTime The window time for the underlying {@link ReplaySubject}.
|
|
30
|
+
* @param selector A function used to setup the multicast.
|
|
31
|
+
* @param timestampProvider The timestamp provider for the underlying {@link ReplaySubject}.
|
|
32
|
+
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
|
33
|
+
* `source.pipe(publishReplay(size, window, selector, scheduler))` is equivalent to
|
|
34
|
+
* `source.pipe(connect(selector, { connector: () => new ReplaySubject(size, window, scheduler) }))`.
|
|
35
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
36
|
+
*/
|
|
37
|
+
export declare function publishReplay<T, O extends ObservableInput<any>>(bufferSize: number | undefined, windowTime: number | undefined, selector: (shared: Observable<T>) => O, timestampProvider?: TimestampProvider): OperatorFunction<T, ObservedValueOf<O>>;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a {@link ConnectableObservable} that uses a {@link ReplaySubject}
|
|
40
|
+
* internally.
|
|
41
|
+
*
|
|
42
|
+
* @param bufferSize The buffer size for the underlying {@link ReplaySubject}.
|
|
43
|
+
* @param windowTime The window time for the underlying {@link ReplaySubject}.
|
|
44
|
+
* @param selector Passing `undefined` here determines that this operator will return a {@link ConnectableObservable}.
|
|
45
|
+
* @param timestampProvider The timestamp provider for the underlying {@link ReplaySubject}.
|
|
46
|
+
* @deprecated Will be removed in v8. To create a connectable observable that uses a
|
|
47
|
+
* {@link ReplaySubject} under the hood, use {@link connectable}.
|
|
48
|
+
* `source.pipe(publishReplay(size, time, scheduler))` is equivalent to
|
|
49
|
+
* `connectable(source, { connector: () => new ReplaySubject(size, time, scheduler), resetOnDisconnect: false })`.
|
|
50
|
+
* If you're using {@link refCount} after `publishReplay`, use the {@link share} operator instead.
|
|
51
|
+
* `publishReplay(size, time, scheduler), refCount()` is equivalent to
|
|
52
|
+
* `share({ connector: () => new ReplaySubject(size, time, scheduler), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
|
|
53
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
54
|
+
*/
|
|
55
|
+
export declare function publishReplay<T, O extends ObservableInput<any>>(bufferSize: number | undefined, windowTime: number | undefined, selector: undefined, timestampProvider: TimestampProvider): OperatorFunction<T, ObservedValueOf<O>>;
|
|
56
|
+
//# sourceMappingURL=publishReplay.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInputTuple } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an Observable that mirrors the first source Observable to emit a next,
|
|
4
|
+
* error or complete notification from the combination of the Observable to which
|
|
5
|
+
* the operator is applied and supplied Observables.
|
|
6
|
+
*
|
|
7
|
+
* ## Example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { interval, map, raceWith } from 'rxjs';
|
|
11
|
+
*
|
|
12
|
+
* const obs1 = interval(7000).pipe(map(() => 'slow one'));
|
|
13
|
+
* const obs2 = interval(3000).pipe(map(() => 'fast one'));
|
|
14
|
+
* const obs3 = interval(5000).pipe(map(() => 'medium one'));
|
|
15
|
+
*
|
|
16
|
+
* obs1
|
|
17
|
+
* .pipe(raceWith(obs2, obs3))
|
|
18
|
+
* .subscribe(winner => console.log(winner));
|
|
19
|
+
*
|
|
20
|
+
* // Outputs
|
|
21
|
+
* // a series of 'fast one'
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param otherSources Sources used to race for which Observable emits first.
|
|
25
|
+
* @return A function that returns an Observable that mirrors the output of the
|
|
26
|
+
* first Observable to emit an item.
|
|
27
|
+
*/
|
|
28
|
+
export declare function raceWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
|
29
|
+
//# sourceMappingURL=raceWith.d.ts.map
|