const a = [1, 2, 3, 4, 5, 6, 7];
from(a.splice(0, 3))
.pipe(
concatMap(val => {
return of(val).pipe(delay(Math.random() * 1000));
}),
tap(val => {
console.log(val);
}),
repeatWhen(completed => completed.pipe(delay(2000))),
tap(val => {
console.log(a);
}),
takeWhile(val => a.length > 0)
)
.subscribe(() => {});
a.splice(0, 3)爲什麽永遠是[1,2,3],而不會變成[4,5,6]