import { from } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
const sampleObject = { name: 'Test' };
// Objects must be same reference
const source$ = from([sampleObject, sampleObject, sampleObject]);
// only emit distinct objects, based on last emitted value
source$
.pipe(distinctUntilChanged())
.subscribe(console.log);
// output: {name: 'Test'}