Demo:  expand

expand creates an observable that recursively applies the given function by taking the result of each calculation as it's next input.

expand( recursiveFunction, seedValue)
//start with the input and keep adding 10 in each iteration
let input = of(5).pipe(
            expand(v => of(v+10).pipe(delay(1500))));

let process = take(5);

let output=input.pipe(process).subscribe(v=>console.log(v))