Demo:  toArray

toArray operator collects all the incoming data into an array and emits as the source completes.

let input = timer(0,1500).pipe(take(4));

//Collect the source items into an array
//and emit at the end
let process = toArray();

let output=input.pipe(process).subscribe(v=>console.log(v))