What should I use instead of toPromise() when using await on an Observable?

后端 未结 1 398
Happy的楠姐
Happy的楠姐 2020-12-20 17:30

This page says \"toPromise has been deprecated! (RxJS 5.5+)\" but I\'ve been using it lately with AngularFire2 (when I only want one result) like this:

相关标签:
1条回答
  • 2020-12-20 17:38

    You just should put after pipe!

       .pipe(take(1)).toPromise
    
    0 讨论(0)
提交回复
热议问题