source: trip-planner-front/node_modules/rxjs/_esm2015/internal/operators/buffer.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 974 bytes
Line 
1import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
2export function buffer(closingNotifier) {
3 return function bufferOperatorFunction(source) {
4 return source.lift(new BufferOperator(closingNotifier));
5 };
6}
7class BufferOperator {
8 constructor(closingNotifier) {
9 this.closingNotifier = closingNotifier;
10 }
11 call(subscriber, source) {
12 return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
13 }
14}
15class 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
Note: See TracBrowser for help on using the repository browser.