Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / operators / buffer.js
1 import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
2 export function buffer(closingNotifier) {
3     return function bufferOperatorFunction(source) {
4         return source.lift(new BufferOperator(closingNotifier));
5     };
6 }
7 class BufferOperator {
8     constructor(closingNotifier) {
9         this.closingNotifier = closingNotifier;
10     }
11     call(subscriber, source) {
12         return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
13     }
14 }
15 class BufferSubscriber extends SimpleOuterSubscriber {
16     constructor(destination, closingNotifier) {
17         super(destination);
18         this.buffer = [];
19         this.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));
20     }
21     _next(value) {
22         this.buffer.push(value);
23     }
24     notifyNext() {
25         const buffer = this.buffer;
26         this.buffer = [];
27         this.destination.next(buffer);
28     }
29 }
30 //# sourceMappingURL=buffer.js.map