hunk.code_window: Other instance operators that take a Scheduler as argument: `cache`, `combineLatest`, `concat`, `expand`, `merge`, `publishReplay`, `startWith`.
   Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queue` Scheduler to provide a clock.
  
hunk.labels: keep keep keep replace
hunk.after_edit: Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queueScheduler` Scheduler to provide a clock.
hunk.file_path: docs_app/content/guide/scheduler.md
hunk.type: replace
file: import { BehaviorSubject } from 'rxjs';
  
  describe('BehaviorSubject', () => {
    it('should handle no generic appropriately', () => {
      const s1 = new BehaviorSubject(); // $ExpectError
    });
  
    it('should handle an argument of string appropriately', () => {
      const init = 'some string';
      const s1 = new BehaviorSubject(init); // $ExpectType BehaviorSubject<string>
      s1.next(); // $ExpectError
      s1.next('test'); // $ExpectType void
      s1.next(32); // $ExpectError
      s1.subscribe(value => {
        const x = value; // $ExpectType string
      });
      const v = s1.getValue(); // $ExpectType string
    });
  
    it('should handle a generic of void appropriately', () => {
      const s1 = new BehaviorSubject<void>(undefined); // $ExpectType BehaviorSubject<void>
      s1.next(); // $ExpectType void
      s1.next('test'); // $ExpectError
      s1.next(32); // $ExpectError
      s1.subscribe(value => {
        const x = value; // $ExpectType void
      });
      const v = s1.getValue(); // $ExpectType void
    });
  
    describe('asObservable', () => {
      it('should return an observable of the same generic type', () => {
        const s1 = new BehaviorSubject('test');
        const o1 = s1.asObservable(); // $ExpectType Observable<string>
  
        const s2 = new BehaviorSubject<void>(undefined);
        const o2 = s2.asObservable(); // $ExpectType Observable<void>
      });
    });
  });