I got this two subjects that both have a delay and I need the second one to be subscribed when the first one is completed, asynchronously. Both subjects only emit once (http requests) and I'm trying to avoid nested subscriptions but I can't figure out an optimal solution.
What I've got so far: Stackblitz
const order = of('2- created order').pipe(
delay(100),
tap(console.log)
);
const google = of('4- logged info to google').pipe(
delay(500),
tap(console.log)
);
console.log('1- started creating order');
order
.pipe(tap(() => google.subscribe()))
.subscribe(() => console.log("3- didn't wait for google"));
// 1- started creating order
// 2- created order
// 3- didn't wait for google
// 4- logged info to google