mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-13 05:55:26 +00:00
update
This commit is contained in:
36
node_modules/rxjs/_esm2015/operator/mergeScan.js
generated
vendored
Normal file
36
node_modules/rxjs/_esm2015/operator/mergeScan.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
import { mergeScan as higherOrder } from '../operators/mergeScan';
|
||||
/**
|
||||
* Applies an accumulator function over the source Observable where the
|
||||
* accumulator function itself returns an Observable, then each intermediate
|
||||
* Observable returned is merged into the output Observable.
|
||||
*
|
||||
* <span class="informal">It's like {@link scan}, but the Observables returned
|
||||
* by the accumulator are merged into the outer Observable.</span>
|
||||
*
|
||||
* @example <caption>Count the number of click events</caption>
|
||||
* const click$ = Rx.Observable.fromEvent(document, 'click');
|
||||
* const one$ = click$.mapTo(1);
|
||||
* const seed = 0;
|
||||
* const count$ = one$.mergeScan((acc, one) => Rx.Observable.of(acc + one), seed);
|
||||
* count$.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results:
|
||||
* 1
|
||||
* 2
|
||||
* 3
|
||||
* 4
|
||||
* // ...and so on for each click
|
||||
*
|
||||
* @param {function(acc: R, value: T): Observable<R>} accumulator
|
||||
* The accumulator function called on each source value.
|
||||
* @param seed The initial accumulation value.
|
||||
* @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of
|
||||
* input Observables being subscribed to concurrently.
|
||||
* @return {Observable<R>} An observable of the accumulated values.
|
||||
* @method mergeScan
|
||||
* @owner Observable
|
||||
*/
|
||||
export function mergeScan(accumulator, seed, concurrent = Number.POSITIVE_INFINITY) {
|
||||
return higherOrder(accumulator, seed, concurrent)(this);
|
||||
}
|
||||
//# sourceMappingURL=mergeScan.js.map
|
Reference in New Issue
Block a user