Is there a Promise.all equivalent in this situation?
let promise1 = performTaskA(); // some promise
let promise2 = performTaskB(); // another promise
// wait for both promises to complete.
Promise.all([promise1, promise2], data => {
// do something;
});
I can't seem to figure it out from the documentation. Some articles mention ForkJoin, but I'm having trouble making it work...
let source1 = new BehaviorSubject(0);
let source2 = new BehaviorSubject(1);
let combinedObservable = new ForkJoinObservable(source1, source2);
source1.subscribe( () => console.log('I am working'));
source2.subscribe( () => console.log('I am working'));
combinedObservable.subscribe( () => console.log('I am not working'));
Maybe I should just go back to using plain old promises.