message: refactor(buffer): smaller impl
diff: -import { Operator } from '../Operator';
  +/** @prettier */
  import { Subscriber } from '../Subscriber';
  import { Observable } from '../Observable';
  import { OperatorFunction } from '../types';
  import { lift } from '../util/lift';
  -import { SimpleInnerSubscriber, SimpleOuterSubscriber, innerSubscribe } from '../innerSubscribe';
  +import { OperatorSubscriber } from './OperatorSubscriber';
  /**
  * Buffers the source Observable values until `closingNotifier` emits.
  @@ -45,43 +45,17 @@ import { SimpleInnerSubscriber, SimpleOuterSubscriber, innerSubscribe } from '..
  * @name buffer
  */
  export function buffer<T>(closingNotifier: Observable<any>): OperatorFunction<T, T[]> {
  - return function bufferOperatorFunction(source: Observable<T>) {
  - return lift(source, new BufferOperator<T>(closingNotifier));
  - };
  -}
  -
  -class BufferOperator<T> implements Operator<T, T[]> {
  -
  - constructor(private closingNotifier: Observable<any>) {
  - }
  -
  - call(subscriber: Subscriber<T[]>, source: any): any {
  - const bufferSubscriber = new BufferSubscriber(subscriber);
  - subscriber.add(source.subscribe(bufferSubscriber));
  - subscriber.add(innerSubscribe(this.closingNotifier, new SimpleInnerSubscriber(bufferSubscriber)));
  - return subscriber;
  - }
  -}
  -
  -/**
  - * We need this JSDoc comment for affecting ESDoc.
  - * @ignore
  - * @extends {Ignored}
  - */
  -class BufferSubscriber<T> extends SimpleOuterSubscriber<T, any> {
  - private buffer: T[] = [];
  -
  - constructor(destination: Subscriber<T[]>) {
  - super(destination);
  - }
  -
  - protected _next(value: T) {
  - this.buffer.push(value);
  - }
  -
  - notifyNext(): void {
  - const buffer = this.buffer;
  - this.buffer = [];
  - this.destination.next(buffer);
  - }
  + return (source: Observable<T>) =>
  + lift(source, function (this: Subscriber<T[]>, source: Observable<T>) {
  + const subscriber = this;
  + let buffer: T[] = [];
  + source.subscribe(new OperatorSubscriber(subscriber, (value) => buffer.push(value)));
  + closingNotifier.subscribe(
  + new OperatorSubscriber(subscriber, () => {
  + const b = buffer;
  + buffer = [];
  + subscriber.next(b);
  + })
  + );
  + });
  }
  