import { Observable } from 'rxjs' ; import { concatMap , filter , mapTo } from 'rxjs/operators' ; export function concatFilter < T > ( predicate ) { return concatMap ( ( value ) => predicate ( value ) . pipe ( filter ( Boolean ) , mapTo ( value ) ) ) ; }