message: refactor(exhaust): smaller impl
diff: -import { Operator } from '../Operator';
  import { Observable } from '../Observable';
  import { Subscriber } from '../Subscriber';
  import { Subscription } from '../Subscription';
  -import { ObservableInput, OperatorFunction, TeardownLogic } from '../types';
  +import { ObservableInput, OperatorFunction } from '../types';
  import { lift } from '../util/lift';
  -import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
  +import { from } from '../observable/from';
  +import { OperatorSubscriber } from './OperatorSubscriber';
  export function exhaust<T>(): OperatorFunction<ObservableInput<T>, T>;
  export function exhaust<R>(): OperatorFunction<any, R>;
  @@ -53,45 +53,20 @@ export function exhaust<R>(): OperatorFunction<any, R>;
  * @name exhaust
  */
  export function exhaust<T>(): OperatorFunction<any, T> {
  - return (source: Observable<T>) => lift(source, new SwitchFirstOperator<T>());
  -}
  -
  -class SwitchFirstOperator<T> implements Operator<T, T> {
  - call(subscriber: Subscriber<T>, source: any): TeardownLogic {
  - return source.subscribe(new SwitchFirstSubscriber(subscriber));
  - }
  -}
  -
  -/**
  - * We need this JSDoc comment for affecting ESDoc.
  - * @ignore
  - * @extends {Ignored}
  - */
  -class SwitchFirstSubscriber<T> extends SimpleOuterSubscriber<T, T> {
  - private hasCompleted = false;
  - private innerSubscription?: Subscription;
  -
  - constructor(destination: Subscriber<T>) {
  - super(destination);
  - }
  -
  - protected _next(value: T): void {
  - if (!this.innerSubscription) {
  - this.add(this.innerSubscription = innerSubscribe(value, new SimpleInnerSubscriber(this)));
  - }
  - }
  -
  - protected _complete(): void {
  - this.hasCompleted = true;
  - if (!this.innerSubscription) {
  - this.destination.complete();
  - }
  - }
  -
  - notifyComplete(): void {
  - this.innerSubscription = undefined;
  - if (this.hasCompleted) {
  - this.destination.complete();
  - }
  + return (source: Observable<ObservableInput<T>>) => lift(source, function (this: Subscriber<T>, source: Observable<ObservableInput<T>>) {
  + const subscriber = this;
  + let isComplete = false;
  + let innerSub: Subscription | null = null;
  + source.subscribe(new OperatorSubscriber(subscriber, inner => {
  + if (!innerSub) {
  + innerSub = from(inner).subscribe(new OperatorSubscriber(subscriber, undefined, undefined, () => {
  + innerSub = null;
  + isComplete && subscriber.complete();
  + }))
  }
  + }, undefined, () => {
  + isComplete = true;
  + !innerSub && subscriber.complete();
  + }))
  + });
  }
  \ No newline at end of file
  