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

后端 未结 1 396
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)
提交回复
热议问题