const subscription = Observable.interval(1000) .pipe( map(x => Math.random() * x), filter(x => x < 1), ) .subscribe(x => console.log(`Logged ${x}`));