Demo: distinctUntilKeyChanged
distinctUntilKeyChanged ensures that the consequtively emitted values are always distinct values for the specified key.
distinctUntilKeyChanged('key')
//First and last items are the same
let input = of({x:2,y:5},{x:5,y:10},{x:5,y:20},{x:2,y:5})
.pipe(concatMap(v=>of(v).pipe(delay(1000))))
//ensures each emit has a distinct 'x' value
//from it's previous one
let process = distinctUntilKeyChanged('x');
//Tooltip on each dot shows the comlete JSON output
let output = input.pipe(process).subscribe(v=>console.log(v))