Why isn't it possible to convert a promise
to an observable
and then use it with withLatestFrom
. It's not clear to me, why this doesn't resolve.
of('')
.pipe(
withLatestFrom(from(myPromise)),
map((res) => {
console.log('does not resolve', res);
})
)
.subscribe();
WithLatestFrom
emits only when its source Observable emits, sinceof('')
emits before the source to withLatestFrom, yourwithLatestFrom
is never triggered.The following code will not work:
but this will: