a zip code crypto-currency system good for red ONLY

mergeScan.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. var mergeScan_1 = require('../operators/mergeScan');
  3. /**
  4. * Applies an accumulator function over the source Observable where the
  5. * accumulator function itself returns an Observable, then each intermediate
  6. * Observable returned is merged into the output Observable.
  7. *
  8. * <span class="informal">It's like {@link scan}, but the Observables returned
  9. * by the accumulator are merged into the outer Observable.</span>
  10. *
  11. * @example <caption>Count the number of click events</caption>
  12. * const click$ = Rx.Observable.fromEvent(document, 'click');
  13. * const one$ = click$.mapTo(1);
  14. * const seed = 0;
  15. * const count$ = one$.mergeScan((acc, one) => Rx.Observable.of(acc + one), seed);
  16. * count$.subscribe(x => console.log(x));
  17. *
  18. * // Results:
  19. * 1
  20. * 2
  21. * 3
  22. * 4
  23. * // ...and so on for each click
  24. *
  25. * @param {function(acc: R, value: T): Observable<R>} accumulator
  26. * The accumulator function called on each source value.
  27. * @param seed The initial accumulation value.
  28. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of
  29. * input Observables being subscribed to concurrently.
  30. * @return {Observable<R>} An observable of the accumulated values.
  31. * @method mergeScan
  32. * @owner Observable
  33. */
  34. function mergeScan(accumulator, seed, concurrent) {
  35. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  36. return mergeScan_1.mergeScan(accumulator, seed, concurrent)(this);
  37. }
  38. exports.mergeScan = mergeScan;
  39. //# sourceMappingURL=mergeScan.js.map