a zip code crypto-currency system good for red ONLY

window.d.ts 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { Observable } from '../Observable';
  2. /**
  3. * Branch out the source Observable values as a nested Observable whenever
  4. * `windowBoundaries` emits.
  5. *
  6. * <span class="informal">It's like {@link buffer}, but emits a nested Observable
  7. * instead of an array.</span>
  8. *
  9. * <img src="./img/window.png" width="100%">
  10. *
  11. * Returns an Observable that emits windows of items it collects from the source
  12. * Observable. The output Observable emits connected, non-overlapping
  13. * windows. It emits the current window and opens a new one whenever the
  14. * Observable `windowBoundaries` emits an item. Because each window is an
  15. * Observable, the output is a higher-order Observable.
  16. *
  17. * @example <caption>In every window of 1 second each, emit at most 2 click events</caption>
  18. * var clicks = Rx.Observable.fromEvent(document, 'click');
  19. * var interval = Rx.Observable.interval(1000);
  20. * var result = clicks.window(interval)
  21. * .map(win => win.take(2)) // each window has at most 2 emissions
  22. * .mergeAll(); // flatten the Observable-of-Observables
  23. * result.subscribe(x => console.log(x));
  24. *
  25. * @see {@link windowCount}
  26. * @see {@link windowTime}
  27. * @see {@link windowToggle}
  28. * @see {@link windowWhen}
  29. * @see {@link buffer}
  30. *
  31. * @param {Observable<any>} windowBoundaries An Observable that completes the
  32. * previous window and starts a new window.
  33. * @return {Observable<Observable<T>>} An Observable of windows, which are
  34. * Observables emitting values of the source Observable.
  35. * @method window
  36. * @owner Observable
  37. */
  38. export declare function window<T>(this: Observable<T>, windowBoundaries: Observable<any>): Observable<Observable<T>>;