1 |
- {"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../src/operator/buffer.ts"],"names":[],"mappings":";AAEA,uBAAsC,qBAAqB,CAAC,CAAA;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,gBAA+C,eAAgC;IAC7E,MAAM,CAAC,eAAW,CAAC,eAAe,CAAC,CAAC,IAAI,CAAoB,CAAC;AAC/D,CAAC;AAFe,cAAM,SAErB,CAAA","sourcesContent":["\nimport { Observable } from '../Observable';\nimport { buffer as higherOrder } from '../operators/buffer';\n\n/**\n * Buffers the source Observable values until `closingNotifier` emits.\n *\n * <span class=\"informal\">Collects values from the past as an array, and emits\n * that array only when another Observable emits.</span>\n *\n * <img src=\"./img/buffer.png\" width=\"100%\">\n *\n * Buffers the incoming Observable values until the given `closingNotifier`\n * Observable emits a value, at which point it emits the buffer on the output\n * Observable and starts a new buffer internally, awaiting the next time\n * `closingNotifier` emits.\n *\n * @example <caption>On every click, emit array of most recent interval events</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var interval = Rx.Observable.interval(1000);\n * var buffered = interval.buffer(clicks);\n * buffered.subscribe(x => console.log(x));\n *\n * @see {@link bufferCount}\n * @see {@link bufferTime}\n * @see {@link bufferToggle}\n * @see {@link bufferWhen}\n * @see {@link window}\n *\n * @param {Observable<any>} closingNotifier An Observable that signals the\n * buffer to be emitted on the output Observable.\n * @return {Observable<T[]>} An Observable of buffers, which are arrays of\n * values.\n * @method buffer\n * @owner Observable\n */\nexport function buffer<T>(this: Observable<T>, closingNotifier: Observable<any>): Observable<T[]> {\n return higherOrder(closingNotifier)(this) as Observable<T[]>;\n}\n"]}
|