I'm trying to count down from a number, lets say 8000, then I reduce all the values into an array. If I count down by 100, 50 or even 10, expand completes and I can see the array in the console, but if I count down by 1 (step = 1), it just stops at a certain number and does nothing, won't continue, won't complete. There are no errors in the console.
Anyone knows what's going on? Does expand have a limit of recursive calls?
const fromValue = 8000;
const step = 1; // Change this value to 1, 10, 100...
rxjs.of(fromValue).pipe(
rxjs.expand(value => {
console.log(value);
return value > 0 ? rxjs.of(value - step) : rxjs.EMPTY;
}),
rxjs.reduce((acc, value) => [...acc, value], [])
).subscribe(result => console.log(result));
<script src="https://unpkg.com/rxjs@7.5.6/dist/bundles/rxjs.umd.min.js"></script>
