Demo: pairwise
The pairwise operator enable us to emit the current value and previous value pairs in arrays.
Its very useful when we need to do thier comparative analysis in our processing.
let input_1 = timer(500,1000).pipe(take(4));
//Emits the current as well the previous one in pairs
let process = pairwise();
let output = input_1.pipe(process).subscribe(v=>console.log(v))