import { Pipe , PipeTransform } from '@angular/core' ; import { Observable } from 'rxjs' ; import { distinctUntilChanged } from 'rxjs/operators' ; @ Pipe ( { name : 'distinctUntilChanged' , pure : true } ) export class DistinctUntilChangedPipe < T > implements PipeTransform { transform ( stream , compare ? ) { return stream . pipe ( distinctUntilChanged ( compare ) ) ; } }