hunk.code_window:     );
       expectObservable(result).toBe(expected, {x: '1', y: '2', z: '3'});
     });
     it('should work for one object', () => {
       const a =   cold('--x--|', {x: {prop: 42}});
       const asubs =    '^    !';
       const expected = '--y--|';
  
hunk.labels: keep keep keep keep add keep keep keep keep
hunk.after_edit:   it('should work for one array', () => {
       const a =   cold('--x--|', {x: ['abc']});
       const asubs =    '^    !';
       const expected = '--y--|';
       const r = a.pipe(pluck(0));
       expectObservable(r).toBe(expected, {y: 'abc'});
       expectSubscriptions(a.subscriptions).toBe(asubs);
     });
  
hunk.file_path: spec/operators/pluck-spec.ts
hunk.type: add
file: import { Subject } from './Subject';
  import { Subscriber } from './Subscriber';
  import { Subscription } from './Subscription';
  
  /**
   * A variant of Subject that only emits a value when it completes. It will emit
   * its latest value to all its observers on completion.
   *
   * @class AsyncSubject<T>
   */
  export class AsyncSubject<T> extends Subject<T> {
    private value: T | null = null;
    private hasNext: boolean = false;
    private hasCompleted: boolean = false;
  
    /** @deprecated This is an internal implementation detail, do not use. */
    _subscribe(subscriber: Subscriber<any>): Subscription {
      if (this.hasError) {
        subscriber.error(this.thrownError);
        return Subscription.EMPTY;
      } else if (this.hasCompleted && this.hasNext) {
        subscriber.next(this.value);
        subscriber.complete();
        return Subscription.EMPTY;
      }
      return super._subscribe(subscriber);
    }
  
    next(value: T): void {
      if (!this.hasCompleted) {
        this.value = value;
        this.hasNext = true;
      }
    }
  
    error(error: any): void {
      if (!this.hasCompleted) {
        super.error(error);
      }
    }
  
    complete(): void {
      this.hasCompleted = true;
      if (this.hasNext) {
        super.next(this.value!);
      }
      super.complete();
    }
  }
  