{"ast":null,"code":"import { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function buffer(closingNotifier) {\n  return function bufferOperatorFunction(source) {\n    return source.lift(new BufferOperator(closingNotifier));\n  };\n}\n\nclass BufferOperator {\n  constructor(closingNotifier) {\n    this.closingNotifier = closingNotifier;\n  }\n\n  call(subscriber, source) {\n    return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));\n  }\n\n}\n\nclass BufferSubscriber extends OuterSubscriber {\n  constructor(destination, closingNotifier) {\n    super(destination);\n    this.buffer = [];\n    this.add(subscribeToResult(this, closingNotifier));\n  }\n\n  _next(value) {\n    this.buffer.push(value);\n  }\n\n  notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n    const buffer = this.buffer;\n    this.buffer = [];\n    this.destination.next(buffer);\n  }\n\n} //# sourceMappingURL=buffer.js.map","map":null,"metadata":{},"sourceType":"module"}