import { empty , of } from 'rxjs' ; import { startWith , endWith , defaultIfEmpty } from 'rxjs/operators' ; empty ( ) . pipe ( defaultIfEmpty ( 42 ) , startWith ( 0 , 1 ) , endWith ( 4 , 5 , 6 ) ) . subscribe ( x => console . log ( x ) ) ;