import { of , interval } from 'rxjs' ; import { filter , map , reduce , scan , take } from 'rxjs/operators' ; export function play ( ... args ) { const arr$ = interval ( 50 ) ; /**
     * To double the odd integers emitted by interval and sum them ...
     * pipe with RxJS array-like operators
     */ const result$ = arr$ . pipe ( take ( 10 ) , filter ( i => i % 2 === 1 ) , map ( i => i * 2 ) , scan ( ( acc , curr ) => acc + curr , 0 ) ) ; return result$ ; }