1 /** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
4 export function buffer(closingNotifier) {
5 return function bufferOperatorFunction(source) {
6 return source.lift(new BufferOperator(closingNotifier));
9 var BufferOperator = /*@__PURE__*/ (function () {
10 function BufferOperator(closingNotifier) {
11 this.closingNotifier = closingNotifier;
13 BufferOperator.prototype.call = function (subscriber, source) {
14 return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
16 return BufferOperator;
18 var BufferSubscriber = /*@__PURE__*/ (function (_super) {
19 tslib_1.__extends(BufferSubscriber, _super);
20 function BufferSubscriber(destination, closingNotifier) {
21 var _this = _super.call(this, destination) || this;
23 _this.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(_this)));
26 BufferSubscriber.prototype._next = function (value) {
27 this.buffer.push(value);
29 BufferSubscriber.prototype.notifyNext = function () {
30 var buffer = this.buffer;
32 this.destination.next(buffer);
34 return BufferSubscriber;
35 }(SimpleOuterSubscriber));
36 //# sourceMappingURL=buffer.js.map