a zip code crypto-currency system good for red ONLY

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /** PURE_IMPORTS_START .._operators_take PURE_IMPORTS_END */
  2. import { take as higherOrder } from '../operators/take';
  3. /**
  4. * Emits only the first `count` values emitted by the source Observable.
  5. *
  6. * <span class="informal">Takes the first `count` values from the source, then
  7. * completes.</span>
  8. *
  9. * <img src="./img/take.png" width="100%">
  10. *
  11. * `take` returns an Observable that emits only the first `count` values emitted
  12. * by the source Observable. If the source emits fewer than `count` values then
  13. * all of its values are emitted. After that, it completes, regardless if the
  14. * source completes.
  15. *
  16. * @example <caption>Take the first 5 seconds of an infinite 1-second interval Observable</caption>
  17. * var interval = Rx.Observable.interval(1000);
  18. * var five = interval.take(5);
  19. * five.subscribe(x => console.log(x));
  20. *
  21. * @see {@link takeLast}
  22. * @see {@link takeUntil}
  23. * @see {@link takeWhile}
  24. * @see {@link skip}
  25. *
  26. * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
  27. * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
  28. *
  29. * @param {number} count The maximum number of `next` values to emit.
  30. * @return {Observable<T>} An Observable that emits only the first `count`
  31. * values emitted by the source Observable, or all of the values from the source
  32. * if the source emits fewer than `count` values.
  33. * @method take
  34. * @owner Observable
  35. */
  36. export function take(count) {
  37. return higherOrder(count)(this);
  38. }
  39. //# sourceMappingURL=take.js.map