@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,43 @@
|
|
|
1
|
+
import { ObservableInputTuple, OperatorFunction, Cons } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Create an observable that combines the latest values from all passed observables and the source
|
|
4
|
+
* into arrays and emits them.
|
|
5
|
+
*
|
|
6
|
+
* Returns an observable, that when subscribed to, will subscribe to the source observable and all
|
|
7
|
+
* sources provided as arguments. Once all sources emit at least one value, all of the latest values
|
|
8
|
+
* will be emitted as an array. After that, every time any source emits a value, all of the latest values
|
|
9
|
+
* will be emitted as an array.
|
|
10
|
+
*
|
|
11
|
+
* This is a useful operator for eagerly calculating values based off of changed inputs.
|
|
12
|
+
*
|
|
13
|
+
* ## Example
|
|
14
|
+
*
|
|
15
|
+
* Simple concatenation of values from two inputs
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { fromEvent, combineLatestWith, map } from 'rxjs';
|
|
19
|
+
*
|
|
20
|
+
* // Setup: Add two inputs to the page
|
|
21
|
+
* const input1 = document.createElement('input');
|
|
22
|
+
* document.body.appendChild(input1);
|
|
23
|
+
* const input2 = document.createElement('input');
|
|
24
|
+
* document.body.appendChild(input2);
|
|
25
|
+
*
|
|
26
|
+
* // Get streams of changes
|
|
27
|
+
* const input1Changes$ = fromEvent(input1, 'change');
|
|
28
|
+
* const input2Changes$ = fromEvent(input2, 'change');
|
|
29
|
+
*
|
|
30
|
+
* // Combine the changes by adding them together
|
|
31
|
+
* input1Changes$.pipe(
|
|
32
|
+
* combineLatestWith(input2Changes$),
|
|
33
|
+
* map(([e1, e2]) => (<HTMLInputElement>e1.target).value + ' - ' + (<HTMLInputElement>e2.target).value)
|
|
34
|
+
* )
|
|
35
|
+
* .subscribe(x => console.log(x));
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param otherSources the other sources to subscribe to.
|
|
39
|
+
* @return A function that returns an Observable that emits the latest
|
|
40
|
+
* emissions from both source and provided Observables.
|
|
41
|
+
*/
|
|
42
|
+
export declare function combineLatestWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, Cons<T, A>>;
|
|
43
|
+
//# sourceMappingURL=combineLatestWith.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a higher-order Observable into a first-order Observable by
|
|
4
|
+
* concatenating the inner Observables in order.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Flattens an Observable-of-Observables by putting one
|
|
7
|
+
* inner Observable after the other.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* Joins every Observable emitted by the source (a higher-order Observable), in
|
|
12
|
+
* a serial fashion. It subscribes to each inner Observable only after the
|
|
13
|
+
* previous inner Observable has completed, and merges all of their values into
|
|
14
|
+
* the returned observable.
|
|
15
|
+
*
|
|
16
|
+
* __Warning:__ If the source Observable emits Observables quickly and
|
|
17
|
+
* endlessly, and the inner Observables it emits generally complete slower than
|
|
18
|
+
* the source emits, you can run into memory issues as the incoming Observables
|
|
19
|
+
* collect in an unbounded buffer.
|
|
20
|
+
*
|
|
21
|
+
* Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set
|
|
22
|
+
* to `1`.
|
|
23
|
+
*
|
|
24
|
+
* ## Example
|
|
25
|
+
*
|
|
26
|
+
* For each click event, tick every second from 0 to 3, with no concurrency
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { fromEvent, map, interval, take, concatAll } from 'rxjs';
|
|
30
|
+
*
|
|
31
|
+
* const clicks = fromEvent(document, 'click');
|
|
32
|
+
* const higherOrder = clicks.pipe(
|
|
33
|
+
* map(() => interval(1000).pipe(take(4)))
|
|
34
|
+
* );
|
|
35
|
+
* const firstOrder = higherOrder.pipe(concatAll());
|
|
36
|
+
* firstOrder.subscribe(x => console.log(x));
|
|
37
|
+
*
|
|
38
|
+
* // Results in the following:
|
|
39
|
+
* // (results are not concurrent)
|
|
40
|
+
* // For every click on the "document" it will emit values 0 to 3 spaced
|
|
41
|
+
* // on a 1000ms interval
|
|
42
|
+
* // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link combineLatestAll}
|
|
46
|
+
* @see {@link concat}
|
|
47
|
+
* @see {@link concatMap}
|
|
48
|
+
* @see {@link concatMapTo}
|
|
49
|
+
* @see {@link exhaustAll}
|
|
50
|
+
* @see {@link mergeAll}
|
|
51
|
+
* @see {@link switchAll}
|
|
52
|
+
* @see {@link switchMap}
|
|
53
|
+
* @see {@link zipAll}
|
|
54
|
+
*
|
|
55
|
+
* @return A function that returns an Observable emitting values from all the
|
|
56
|
+
* inner Observables concatenated.
|
|
57
|
+
*/
|
|
58
|
+
export declare function concatAll<O extends ObservableInput<any>>(): OperatorFunction<O, ObservedValueOf<O>>;
|
|
59
|
+
//# sourceMappingURL=concatAll.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
export declare function concatMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O): 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 concatMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined): 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 concatMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;
|
|
7
|
+
//# sourceMappingURL=concatMap.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
/** @deprecated Will be removed in v9. Use {@link concatMap} instead: `concatMap(() => result)` */
|
|
3
|
+
export declare function concatMapTo<O extends ObservableInput<unknown>>(observable: O): OperatorFunction<unknown, ObservedValueOf<O>>;
|
|
4
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
5
|
+
export declare function concatMapTo<O extends ObservableInput<unknown>>(observable: O, resultSelector: undefined): OperatorFunction<unknown, ObservedValueOf<O>>;
|
|
6
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
7
|
+
export declare function concatMapTo<T, R, O extends ObservableInput<unknown>>(observable: O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;
|
|
8
|
+
//# sourceMappingURL=concatMapTo.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ObservableInputTuple, OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits all of the values from the source observable, then, once it completes, subscribes
|
|
4
|
+
* to each observable source provided, one at a time, emitting all of their values, and not subscribing
|
|
5
|
+
* to the next one until it completes.
|
|
6
|
+
*
|
|
7
|
+
* `concat(a$, b$, c$)` is the same as `a$.pipe(concatWith(b$, c$))`.
|
|
8
|
+
*
|
|
9
|
+
* ## Example
|
|
10
|
+
*
|
|
11
|
+
* Listen for one mouse click, then listen for all mouse moves.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { fromEvent, map, take, concatWith } from 'rxjs';
|
|
15
|
+
*
|
|
16
|
+
* const clicks$ = fromEvent(document, 'click');
|
|
17
|
+
* const moves$ = fromEvent(document, 'mousemove');
|
|
18
|
+
*
|
|
19
|
+
* clicks$.pipe(
|
|
20
|
+
* map(() => 'click'),
|
|
21
|
+
* take(1),
|
|
22
|
+
* concatWith(
|
|
23
|
+
* moves$.pipe(
|
|
24
|
+
* map(() => 'move')
|
|
25
|
+
* )
|
|
26
|
+
* )
|
|
27
|
+
* )
|
|
28
|
+
* .subscribe(x => console.log(x));
|
|
29
|
+
*
|
|
30
|
+
* // 'click'
|
|
31
|
+
* // 'move'
|
|
32
|
+
* // 'move'
|
|
33
|
+
* // 'move'
|
|
34
|
+
* // ...
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param otherSources Other observable sources to subscribe to, in sequence, after the original source is complete.
|
|
38
|
+
* @return A function that returns an Observable that concatenates
|
|
39
|
+
* subscriptions to the source and provided Observables subscribing to the next
|
|
40
|
+
* only once the current subscription completes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function concatWith<T, A extends readonly unknown[]>(...otherSources: [...ObservableInputTuple<A>]): OperatorFunction<T, T | A[number]>;
|
|
43
|
+
//# sourceMappingURL=concatWith.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf, SubjectLike } from '../types';
|
|
2
|
+
import { Observable } from '../Observable';
|
|
3
|
+
/**
|
|
4
|
+
* An object used to configure {@link connect} operator.
|
|
5
|
+
*/
|
|
6
|
+
export interface ConnectConfig<T> {
|
|
7
|
+
/**
|
|
8
|
+
* A factory function used to create the Subject through which the source
|
|
9
|
+
* is multicast. By default, this creates a {@link Subject}.
|
|
10
|
+
*/
|
|
11
|
+
connector: () => SubjectLike<T>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates an observable by multicasting the source within a function that
|
|
15
|
+
* allows the developer to define the usage of the multicast prior to connection.
|
|
16
|
+
*
|
|
17
|
+
* This is particularly useful if the observable source you wish to multicast could
|
|
18
|
+
* be synchronous or asynchronous. This sets it apart from {@link share}, which, in the
|
|
19
|
+
* case of totally synchronous sources will fail to share a single subscription with
|
|
20
|
+
* multiple consumers, as by the time the subscription to the result of {@link share}
|
|
21
|
+
* has returned, if the source is synchronous its internal reference count will jump from
|
|
22
|
+
* 0 to 1 back to 0 and reset.
|
|
23
|
+
*
|
|
24
|
+
* To use `connect`, you provide a `selector` function that will give you
|
|
25
|
+
* a multicast observable that is not yet connected. You then use that multicast observable
|
|
26
|
+
* to create a resulting observable that, when subscribed, will set up your multicast. This is
|
|
27
|
+
* generally, but not always, accomplished with {@link merge}.
|
|
28
|
+
*
|
|
29
|
+
* Note that using a {@link takeUntil} inside of `connect`'s `selector` _might_ mean you were looking
|
|
30
|
+
* to use the {@link takeWhile} operator instead.
|
|
31
|
+
*
|
|
32
|
+
* When you subscribe to the result of `connect`, the `selector` function will be called. After
|
|
33
|
+
* the `selector` function returns, the observable it returns will be subscribed to, _then_ the
|
|
34
|
+
* multicast will be connected to the source.
|
|
35
|
+
*
|
|
36
|
+
* ## Example
|
|
37
|
+
*
|
|
38
|
+
* Sharing a totally synchronous observable
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { of, tap, connect, merge, map, filter } from 'rxjs';
|
|
42
|
+
*
|
|
43
|
+
* const source$ = of(1, 2, 3, 4, 5).pipe(
|
|
44
|
+
* tap({
|
|
45
|
+
* subscribe: () => console.log('subscription started'),
|
|
46
|
+
* next: n => console.log(`source emitted ${ n }`)
|
|
47
|
+
* })
|
|
48
|
+
* );
|
|
49
|
+
*
|
|
50
|
+
* source$.pipe(
|
|
51
|
+
* // Notice in here we're merging 3 subscriptions to `shared$`.
|
|
52
|
+
* connect(shared$ => merge(
|
|
53
|
+
* shared$.pipe(map(n => `all ${ n }`)),
|
|
54
|
+
* shared$.pipe(filter(n => n % 2 === 0), map(n => `even ${ n }`)),
|
|
55
|
+
* shared$.pipe(filter(n => n % 2 === 1), map(n => `odd ${ n }`))
|
|
56
|
+
* ))
|
|
57
|
+
* )
|
|
58
|
+
* .subscribe(console.log);
|
|
59
|
+
*
|
|
60
|
+
* // Expected output: (notice only one subscription)
|
|
61
|
+
* 'subscription started'
|
|
62
|
+
* 'source emitted 1'
|
|
63
|
+
* 'all 1'
|
|
64
|
+
* 'odd 1'
|
|
65
|
+
* 'source emitted 2'
|
|
66
|
+
* 'all 2'
|
|
67
|
+
* 'even 2'
|
|
68
|
+
* 'source emitted 3'
|
|
69
|
+
* 'all 3'
|
|
70
|
+
* 'odd 3'
|
|
71
|
+
* 'source emitted 4'
|
|
72
|
+
* 'all 4'
|
|
73
|
+
* 'even 4'
|
|
74
|
+
* 'source emitted 5'
|
|
75
|
+
* 'all 5'
|
|
76
|
+
* 'odd 5'
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param selector A function used to set up the multicast. Gives you a multicast observable
|
|
80
|
+
* that is not yet connected. With that, you're expected to create and return
|
|
81
|
+
* and Observable, that when subscribed to, will utilize the multicast observable.
|
|
82
|
+
* After this function is executed -- and its return value subscribed to -- the
|
|
83
|
+
* operator will subscribe to the source, and the connection will be made.
|
|
84
|
+
* @param config The configuration object for `connect`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function connect<T, O extends ObservableInput<unknown>>(selector: (shared: Observable<T>) => O, config?: ConnectConfig<T>): OperatorFunction<T, ObservedValueOf<O>>;
|
|
87
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Counts the number of emissions on the source and emits that number when the
|
|
4
|
+
* source completes.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Tells how many values were emitted, when the source
|
|
7
|
+
* completes.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `count` transforms an Observable that emits values into an Observable that
|
|
12
|
+
* emits a single value that represents the number of values emitted by the
|
|
13
|
+
* source Observable. If the source Observable terminates with an error, `count`
|
|
14
|
+
* will pass this error notification along without emitting a value first. If
|
|
15
|
+
* the source Observable does not terminate at all, `count` will neither emit
|
|
16
|
+
* a value nor terminate. This operator takes an optional `predicate` function
|
|
17
|
+
* as argument, in which case the output emission will represent the number of
|
|
18
|
+
* source values that matched `true` with the `predicate`.
|
|
19
|
+
*
|
|
20
|
+
* ## Examples
|
|
21
|
+
*
|
|
22
|
+
* Counts how many seconds have passed before the first click happened
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { interval, fromEvent, takeUntil, count } from 'rxjs';
|
|
26
|
+
*
|
|
27
|
+
* const seconds = interval(1000);
|
|
28
|
+
* const clicks = fromEvent(document, 'click');
|
|
29
|
+
* const secondsBeforeClick = seconds.pipe(takeUntil(clicks));
|
|
30
|
+
* const result = secondsBeforeClick.pipe(count());
|
|
31
|
+
* result.subscribe(x => console.log(x));
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Counts how many odd numbers are there between 1 and 7
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { range, count } from 'rxjs';
|
|
38
|
+
*
|
|
39
|
+
* const numbers = range(1, 7);
|
|
40
|
+
* const result = numbers.pipe(count(i => i % 2 === 1));
|
|
41
|
+
* result.subscribe(x => console.log(x));
|
|
42
|
+
* // Results in:
|
|
43
|
+
* // 4
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @see {@link max}
|
|
47
|
+
* @see {@link min}
|
|
48
|
+
* @see {@link reduce}
|
|
49
|
+
*
|
|
50
|
+
* @param predicate A function that is used to analyze the value and the index and
|
|
51
|
+
* determine whether or not to increment the count. Return `true` to increment the count,
|
|
52
|
+
* and return `false` to keep the count the same.
|
|
53
|
+
* If the predicate is not provided, every value will be counted.
|
|
54
|
+
* @return A function that returns an Observable that emits one number that
|
|
55
|
+
* represents the count of emissions.
|
|
56
|
+
*/
|
|
57
|
+
export declare function count<T>(predicate?: (value: T, index: number) => boolean): OperatorFunction<T, number>;
|
|
58
|
+
//# sourceMappingURL=count.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits a notification from the source Observable only after a particular time span
|
|
4
|
+
* determined by another Observable has passed without another source emission.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">It's like {@link debounceTime}, but the time span of
|
|
7
|
+
* emission silence is determined by a second Observable.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `debounce` delays notifications emitted by the source Observable, but drops previous
|
|
12
|
+
* pending delayed emissions if a new notification arrives on the source Observable.
|
|
13
|
+
* This operator keeps track of the most recent notification from the source
|
|
14
|
+
* Observable, and spawns a duration Observable by calling the
|
|
15
|
+
* `durationSelector` function. The notification is emitted only when the duration
|
|
16
|
+
* Observable emits a next notification, and if no other notification was emitted on
|
|
17
|
+
* the source Observable since the duration Observable was spawned. If a new
|
|
18
|
+
* notification appears before the duration Observable emits, the previous notification will
|
|
19
|
+
* not be emitted and a new duration is scheduled from `durationSelector` is scheduled.
|
|
20
|
+
* If the completing event happens during the scheduled duration the last cached notification
|
|
21
|
+
* is emitted before the completion event is forwarded to the output observable.
|
|
22
|
+
* If the error event happens during the scheduled duration or after it only the error event is
|
|
23
|
+
* forwarded to the output observable. The cache notification is not emitted in this case.
|
|
24
|
+
*
|
|
25
|
+
* Like {@link debounceTime}, this is a rate-limiting operator, and also a
|
|
26
|
+
* delay-like operator since output emissions do not necessarily occur at the
|
|
27
|
+
* same time as they did on the source Observable.
|
|
28
|
+
*
|
|
29
|
+
* ## Example
|
|
30
|
+
*
|
|
31
|
+
* Emit the most recent click after a burst of clicks
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { fromEvent, scan, debounce, interval } from 'rxjs';
|
|
35
|
+
*
|
|
36
|
+
* const clicks = fromEvent(document, 'click');
|
|
37
|
+
* const result = clicks.pipe(
|
|
38
|
+
* scan(i => ++i, 1),
|
|
39
|
+
* debounce(i => interval(200 * i))
|
|
40
|
+
* );
|
|
41
|
+
* result.subscribe(x => console.log(x));
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link audit}
|
|
45
|
+
* @see {@link auditTime}
|
|
46
|
+
* @see {@link debounceTime}
|
|
47
|
+
* @see {@link delay}
|
|
48
|
+
* @see {@link sample}
|
|
49
|
+
* @see {@link sampleTime}
|
|
50
|
+
* @see {@link throttle}
|
|
51
|
+
* @see {@link throttleTime}
|
|
52
|
+
*
|
|
53
|
+
* @param durationSelector A function
|
|
54
|
+
* that receives a value from the source Observable, for computing the timeout
|
|
55
|
+
* duration for each source value, returned as an Observable or a Promise.
|
|
56
|
+
* @return A function that returns an Observable that delays the emissions of
|
|
57
|
+
* the source Observable by the specified duration Observable returned by
|
|
58
|
+
* `durationSelector`, and may drop some values if they occur too frequently.
|
|
59
|
+
*/
|
|
60
|
+
export declare function debounce<T>(durationSelector: (value: T) => ObservableInput<any>): MonoTypeOperatorFunction<T>;
|
|
61
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits a notification from the source Observable only after a particular time span
|
|
4
|
+
* has passed without another source emission.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">It's like {@link delay}, but passes only the most
|
|
7
|
+
* recent notification from each burst of emissions.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `debounceTime` delays notifications emitted by the source Observable, but drops
|
|
12
|
+
* previous pending delayed emissions if a new notification arrives on the source
|
|
13
|
+
* Observable. This operator keeps track of the most recent notification from the
|
|
14
|
+
* source Observable, and emits that only when `dueTime` has passed
|
|
15
|
+
* without any other notification appearing on the source Observable. If a new value
|
|
16
|
+
* appears before `dueTime` silence occurs, the previous notification will be dropped
|
|
17
|
+
* and will not be emitted and a new `dueTime` is scheduled.
|
|
18
|
+
* If the completing event happens during `dueTime` the last cached notification
|
|
19
|
+
* is emitted before the completion event is forwarded to the output observable.
|
|
20
|
+
* If the error event happens during `dueTime` or after it only the error event is
|
|
21
|
+
* forwarded to the output observable. The cache notification is not emitted in this case.
|
|
22
|
+
*
|
|
23
|
+
* This is a rate-limiting operator, because it is impossible for more than one
|
|
24
|
+
* notification to be emitted in any time window of duration `dueTime`, but it is also
|
|
25
|
+
* a delay-like operator since output emissions do not occur at the same time as
|
|
26
|
+
* they did on the source Observable. Optionally takes a {@link SchedulerLike} for
|
|
27
|
+
* managing timers.
|
|
28
|
+
*
|
|
29
|
+
* ## Example
|
|
30
|
+
*
|
|
31
|
+
* Emit the most recent click after a burst of clicks
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { fromEvent, debounceTime } from 'rxjs';
|
|
35
|
+
*
|
|
36
|
+
* const clicks = fromEvent(document, 'click');
|
|
37
|
+
* const result = clicks.pipe(debounceTime(1000));
|
|
38
|
+
* result.subscribe(x => console.log(x));
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link audit}
|
|
42
|
+
* @see {@link auditTime}
|
|
43
|
+
* @see {@link debounce}
|
|
44
|
+
* @see {@link sample}
|
|
45
|
+
* @see {@link sampleTime}
|
|
46
|
+
* @see {@link throttle}
|
|
47
|
+
* @see {@link throttleTime}
|
|
48
|
+
*
|
|
49
|
+
* @param {number} dueTime The timeout duration in milliseconds (or the time
|
|
50
|
+
* unit determined internally by the optional `scheduler`) for the window of
|
|
51
|
+
* time required to wait for emission silence before emitting the most recent
|
|
52
|
+
* source value.
|
|
53
|
+
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for
|
|
54
|
+
* managing the timers that handle the timeout for each value.
|
|
55
|
+
* @return A function that returns an Observable that delays the emissions of
|
|
56
|
+
* the source Observable by the specified `dueTime`, and may drop some values
|
|
57
|
+
* if they occur too frequently.
|
|
58
|
+
*/
|
|
59
|
+
export declare function debounceTime<T>(dueTime: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
|
60
|
+
//# sourceMappingURL=debounceTime.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits a given value if the source Observable completes without emitting any
|
|
4
|
+
* `next` value, otherwise mirrors the source Observable.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">If the source Observable turns out to be empty, then
|
|
7
|
+
* this operator will emit a default value.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `defaultIfEmpty` emits the values emitted by the source Observable or a
|
|
12
|
+
* specified default value if the source Observable is empty (completes without
|
|
13
|
+
* having emitted any `next` value).
|
|
14
|
+
*
|
|
15
|
+
* ## Example
|
|
16
|
+
*
|
|
17
|
+
* If no clicks happen in 5 seconds, then emit 'no clicks'
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { fromEvent, takeUntil, interval, defaultIfEmpty } from 'rxjs';
|
|
21
|
+
*
|
|
22
|
+
* const clicks = fromEvent(document, 'click');
|
|
23
|
+
* const clicksBeforeFive = clicks.pipe(takeUntil(interval(5000)));
|
|
24
|
+
* const result = clicksBeforeFive.pipe(defaultIfEmpty('no clicks'));
|
|
25
|
+
* result.subscribe(x => console.log(x));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see {@link empty}
|
|
29
|
+
* @see {@link last}
|
|
30
|
+
*
|
|
31
|
+
* @param defaultValue The default value used if the source
|
|
32
|
+
* Observable is empty.
|
|
33
|
+
* @return A function that returns an Observable that emits either the
|
|
34
|
+
* specified `defaultValue` if the source Observable emits no items, or the
|
|
35
|
+
* values emitted by the source Observable.
|
|
36
|
+
*/
|
|
37
|
+
export declare function defaultIfEmpty<T, R>(defaultValue: R): OperatorFunction<T, T | R>;
|
|
38
|
+
//# sourceMappingURL=defaultIfEmpty.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Delays the emission of items from the source Observable by a given timeout or
|
|
4
|
+
* until a given Date.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Time shifts each item by some specified amount of
|
|
7
|
+
* milliseconds.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* If the delay argument is a Number, this operator time shifts the source
|
|
12
|
+
* Observable by that amount of time expressed in milliseconds. The relative
|
|
13
|
+
* time intervals between the values are preserved.
|
|
14
|
+
*
|
|
15
|
+
* If the delay argument is a Date, this operator time shifts the start of the
|
|
16
|
+
* Observable execution until the given date occurs.
|
|
17
|
+
*
|
|
18
|
+
* ## Examples
|
|
19
|
+
*
|
|
20
|
+
* Delay each click by one second
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { fromEvent, delay } from 'rxjs';
|
|
24
|
+
*
|
|
25
|
+
* const clicks = fromEvent(document, 'click');
|
|
26
|
+
* const delayedClicks = clicks.pipe(delay(1000)); // each click emitted after 1 second
|
|
27
|
+
* delayedClicks.subscribe(x => console.log(x));
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Delay all clicks until a future date happens
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { fromEvent, delay } from 'rxjs';
|
|
34
|
+
*
|
|
35
|
+
* const clicks = fromEvent(document, 'click');
|
|
36
|
+
* const date = new Date('March 15, 2050 12:00:00'); // in the future
|
|
37
|
+
* const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date
|
|
38
|
+
* delayedClicks.subscribe(x => console.log(x));
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link delayWhen}
|
|
42
|
+
* @see {@link throttle}
|
|
43
|
+
* @see {@link throttleTime}
|
|
44
|
+
* @see {@link debounce}
|
|
45
|
+
* @see {@link debounceTime}
|
|
46
|
+
* @see {@link sample}
|
|
47
|
+
* @see {@link sampleTime}
|
|
48
|
+
* @see {@link audit}
|
|
49
|
+
* @see {@link auditTime}
|
|
50
|
+
*
|
|
51
|
+
* @param {number|Date} due The delay duration in milliseconds (a `number`) or
|
|
52
|
+
* a `Date` until which the emission of the source items is delayed.
|
|
53
|
+
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for
|
|
54
|
+
* managing the timers that handle the time-shift for each item.
|
|
55
|
+
* @return A function that returns an Observable that delays the emissions of
|
|
56
|
+
* the source Observable by the specified timeout or Date.
|
|
57
|
+
*/
|
|
58
|
+
export declare function delay<T>(due: number | Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
|
59
|
+
//# sourceMappingURL=delay.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
|
3
|
+
/** @deprecated The `subscriptionDelay` parameter will be removed in v8. */
|
|
4
|
+
export declare function delayWhen<T>(delayDurationSelector: (value: T, index: number) => ObservableInput<any>, subscriptionDelay: Observable<any>): MonoTypeOperatorFunction<T>;
|
|
5
|
+
export declare function delayWhen<T>(delayDurationSelector: (value: T, index: number) => ObservableInput<any>): MonoTypeOperatorFunction<T>;
|
|
6
|
+
//# sourceMappingURL=delayWhen.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableNotification, ValueFromNotification } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an Observable of {@link ObservableNotification} objects into the emissions
|
|
4
|
+
* that they represent.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Unwraps {@link ObservableNotification} objects as actual `next`,
|
|
7
|
+
* `error` and `complete` emissions. The opposite of {@link materialize}.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `dematerialize` is assumed to operate an Observable that only emits
|
|
12
|
+
* {@link ObservableNotification} objects as `next` emissions, and does not emit any
|
|
13
|
+
* `error`. Such Observable is the output of a `materialize` operation. Those
|
|
14
|
+
* notifications are then unwrapped using the metadata they contain, and emitted
|
|
15
|
+
* as `next`, `error`, and `complete` on the output Observable.
|
|
16
|
+
*
|
|
17
|
+
* Use this operator in conjunction with {@link materialize}.
|
|
18
|
+
*
|
|
19
|
+
* ## Example
|
|
20
|
+
*
|
|
21
|
+
* Convert an Observable of Notifications to an actual Observable
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { NextNotification, ErrorNotification, of, dematerialize } from 'rxjs';
|
|
25
|
+
*
|
|
26
|
+
* const notifA: NextNotification<string> = { kind: 'N', value: 'A' };
|
|
27
|
+
* const notifB: NextNotification<string> = { kind: 'N', value: 'B' };
|
|
28
|
+
* const notifE: ErrorNotification = { kind: 'E', error: new TypeError('x.toUpperCase is not a function') };
|
|
29
|
+
*
|
|
30
|
+
* const materialized = of(notifA, notifB, notifE);
|
|
31
|
+
*
|
|
32
|
+
* const upperCase = materialized.pipe(dematerialize());
|
|
33
|
+
* upperCase.subscribe({
|
|
34
|
+
* next: x => console.log(x),
|
|
35
|
+
* error: e => console.error(e)
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Results in:
|
|
39
|
+
* // A
|
|
40
|
+
* // B
|
|
41
|
+
* // TypeError: x.toUpperCase is not a function
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link materialize}
|
|
45
|
+
*
|
|
46
|
+
* @return A function that returns an Observable that emits items and
|
|
47
|
+
* notifications embedded in Notification objects emitted by the source
|
|
48
|
+
* Observable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dematerialize<N extends ObservableNotification<any>>(): OperatorFunction<N, ValueFromNotification<N>>;
|
|
51
|
+
//# sourceMappingURL=dematerialize.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items.
|
|
4
|
+
*
|
|
5
|
+
* If a `keySelector` function is provided, then it will project each value from the source observable into a new value that it will
|
|
6
|
+
* check for equality with previously projected values. If the `keySelector` function is not provided, it will use each value from the
|
|
7
|
+
* source observable directly with an equality check against previous values.
|
|
8
|
+
*
|
|
9
|
+
* In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking.
|
|
10
|
+
*
|
|
11
|
+
* In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the
|
|
12
|
+
* hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct`
|
|
13
|
+
* use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so
|
|
14
|
+
* that the internal `Set` can be "flushed", basically clearing it of values.
|
|
15
|
+
*
|
|
16
|
+
* ## Examples
|
|
17
|
+
*
|
|
18
|
+
* A simple example with numbers
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { of, distinct } from 'rxjs';
|
|
22
|
+
*
|
|
23
|
+
* of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1)
|
|
24
|
+
* .pipe(distinct())
|
|
25
|
+
* .subscribe(x => console.log(x));
|
|
26
|
+
*
|
|
27
|
+
* // Outputs
|
|
28
|
+
* // 1
|
|
29
|
+
* // 2
|
|
30
|
+
* // 3
|
|
31
|
+
* // 4
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* An example using the `keySelector` function
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { of, distinct } from 'rxjs';
|
|
38
|
+
*
|
|
39
|
+
* of(
|
|
40
|
+
* { age: 4, name: 'Foo'},
|
|
41
|
+
* { age: 7, name: 'Bar'},
|
|
42
|
+
* { age: 5, name: 'Foo'}
|
|
43
|
+
* )
|
|
44
|
+
* .pipe(distinct(({ name }) => name))
|
|
45
|
+
* .subscribe(x => console.log(x));
|
|
46
|
+
*
|
|
47
|
+
* // Outputs
|
|
48
|
+
* // { age: 4, name: 'Foo' }
|
|
49
|
+
* // { age: 7, name: 'Bar' }
|
|
50
|
+
* ```
|
|
51
|
+
* @see {@link distinctUntilChanged}
|
|
52
|
+
* @see {@link distinctUntilKeyChanged}
|
|
53
|
+
*
|
|
54
|
+
* @param keySelector Optional `function` to select which value you want to check as distinct.
|
|
55
|
+
* @param flushes Optional `ObservableInput` for flushing the internal HashSet of the operator.
|
|
56
|
+
* @return A function that returns an Observable that emits items from the
|
|
57
|
+
* source Observable with distinct values.
|
|
58
|
+
*/
|
|
59
|
+
export declare function distinct<T, K>(keySelector?: (value: T) => K, flushes?: ObservableInput<any>): MonoTypeOperatorFunction<T>;
|
|
60
|
+
//# sourceMappingURL=distinct.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
export declare function distinctUntilChanged<T>(comparator?: (previous: T, current: T) => boolean): MonoTypeOperatorFunction<T>;
|
|
3
|
+
export declare function distinctUntilChanged<T, K>(comparator: (previous: K, current: K) => boolean, keySelector: (value: T) => K): MonoTypeOperatorFunction<T>;
|
|
4
|
+
//# sourceMappingURL=distinctUntilChanged.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
export declare function distinctUntilKeyChanged<T>(key: keyof T): MonoTypeOperatorFunction<T>;
|
|
3
|
+
export declare function distinctUntilKeyChanged<T, K extends keyof T>(key: K, compare: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction<T>;
|
|
4
|
+
//# sourceMappingURL=distinctUntilKeyChanged.d.ts.map
|