This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/_esm2015/internal/operators/buffer.js

31 lines
1,019 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
import { OuterSubscriber } from '../OuterSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
export function buffer(closingNotifier) {
return function bufferOperatorFunction(source) {
return source.lift(new BufferOperator(closingNotifier));
};
}
class BufferOperator {
constructor(closingNotifier) {
this.closingNotifier = closingNotifier;
}
call(subscriber, source) {
return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
}
}
class BufferSubscriber extends OuterSubscriber {
constructor(destination, closingNotifier) {
super(destination);
this.buffer = [];
this.add(subscribeToResult(this, closingNotifier));
}
_next(value) {
this.buffer.push(value);
}
notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
const buffer = this.buffer;
this.buffer = [];
this.destination.next(buffer);
}
}
//# sourceMappingURL=buffer.js.map