是否有一个 Promise.all 的等价物?
let prom1 = doA(); // some promise
let prom2 = doB(); // another promise
// wait for both promises to complete.
Promise.all([prom1, prom2], values => {
// do something;
});
无法从文档中将其拼凑在一起,各种文章都建议使用 ForkJoin,但无法使其正常工作...
let behaviour1 = new BehaviourSubject(0);
let behaviour2 = new BehaviourSubject(1);
let allObserver = new ForkJoinObservable(behaviour1, behaviour2);
behaviour1.subscribe( () => console.log('i work'));
behaviour2.subscribe( () => console.log('i work'));
allObserver.subscribe( () => console.log('i dont work'));
可能只是切换回诺言的理智世界。