I was under impression that Observable.[prototype.]concat
makes sure first operation is fully finished before second operation starts. But in following code:
Observable
.concat(
Observable.fromNodeCallback(rimraf)(path.resolve('./some_dir')),
Observable.fromNodeCallback(mkdir)(path.resolve('./some_dir')),
writeToSomeDir$
)
mkdir
attempts (and fails) to create ./some_dir
before rimraf
is finished deleting the dir. At the end (of throwing) however, ./some_dir
ends up getting deleted.
Why is Observable.concat
showing such behaviour? How can I make sure first Observable is fully finished before starting with second Observable without falling to sync version of rimraf?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…