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