message: refactor(pairwise): smaller impl
diff: -import { Operator } from '../Operator';
  +/** @prettier */
  import { Observable } from '../Observable';
  import { Subscriber } from '../Subscriber';
  import { OperatorFunction } from '../types';
  import { lift } from '../util/lift';
  +import { OperatorSubscriber } from './OperatorSubscriber';
  /**
  * Groups pairs of consecutive emissions together and emits them as an array of
  @@ -47,41 +48,18 @@ import { lift } from '../util/lift';
  * @name pairwise
  */
  export function pairwise<T>(): OperatorFunction<T, [T, T]> {
  - return (source: Observable<T>) => lift(source, new PairwiseOperator());
  -}
  -
  -class PairwiseOperator<T> implements Operator<T, [T, T]> {
  - call(subscriber: Subscriber<[T, T]>, source: any): any {
  - return source.subscribe(new PairwiseSubscriber(subscriber));
  - }
  -}
  -
  -/**
  - * We need this JSDoc comment for affecting ESDoc.
  - * @ignore
  - * @extends {Ignored}
  - */
  -class PairwiseSubscriber<T> extends Subscriber<T> {
  - private prev: T | undefined;
  - private hasPrev: boolean = false;
  -
  - constructor(destination: Subscriber<[T, T]>) {
  - super(destination);
  - }
  -
  - _next(value: T): void {
  - let pair: [T, T] | undefined;
  -
  - if (this.hasPrev) {
  - pair = [this.prev!, value];
  - } else {
  - this.hasPrev = true;
  - }
  -
  - this.prev = value;
  -
  - if (pair) {
  - this.destination.next(pair);
  - }
  - }
  + return (source: Observable<T>) =>
  + lift(source, function (this: Subscriber<[T, T]>, source: Observable<T>) {
  + const subscriber = this;
  + let prev: T;
  + let hasPrev = false;
  + source.subscribe(
  + new OperatorSubscriber(subscriber, (value) => {
  + const p = prev;
  + prev = value;
  + hasPrev && subscriber.next([p, value]);
  + hasPrev = true;
  + })
  + );
  + });
  }
  