Closed huan closed 6 years ago
SOLUTION:
await behaviorSubject.asObservable.first().toPromise()
The magic resides in the above first()
which will make it work as expected.
UPDATE: for anyone else viewing this later the solution would be:
await behaviorSubject.pipe(take(1)).toPromise()
@ErraticFox Thanks! We are in the stage of RxJS 6 now! 🎉
UPDATE: for anyone else viewing this later the solution would be:
await behaviorSubject.pipe(take(1)).toPromise()
Works! Thx! Not all hero wear capes.
@PabloPerezAguilo just make sure to pay the good deed forward. :)
We will expect it resolve immediately but it doesn't.
See: https://github.com/Reactive-Extensions/RxJS/issues/1088 - BehaviourSubject toPromise isn't working
UPDATE: