Demo: combineLatest
The combineLatest emits the latest item from each of the given sources in an array and it emits whenever an item arrives from any of the sources.
let input_1 = timer(500,1000).pipe(take(4));
let input_2 = interval(2000).pipe(take(2));
//emits the latest items from the given sources in an array
let combinedInput = combineLatest(input_1 , input_2);
let output = combinedInput.subscribe(v=>console.log(v))