No Observables out if piping debounceTime and switchMap/ mergeMap returning empty observable

Bug Report

Current Behavior
No result would be output if I piped debounceTime with siwtchMap/ mergeMap returning empty.

Reproduction

  • REPL or Repo link:
import { fromEvent, timer, empty } from 'rxjs';
import { debounceTime, map, switchMap } from 'rxjs/operators';

const input = document.getElementById('example');

//  for every keyup, map to current input value
const example = fromEvent(input, 'keyup').pipe(map(i => i.currentTarget.value));

// wait .5s between keyups to emit current value
//throw away all other values
const debouncedInput = example.pipe(debounceTime(500), switchMap(() => empty()));

// log values
const subscribe = debouncedInput.subscribe(val => {
  console.log(`Debounced Input: ${val}`);
});

Expected behavior
empty observables are emitted.

Environment

  • Runtime: any
  • RxJS version: v6.2.0

1 possible answer(s) on “No Observables out if piping debounceTime and switchMap/ mergeMap returning empty observable