Understanding the toPromise() deprecation
One of the major deprecations of RxJS 7 is the toPromise()
deprecation. toPromise()
will be deleted permanently after the release of RxJS 8. So, it is highly recommended that you avoid using toPromise()
in your future developments.
Now, let's give a little bit of background to understand the reason behind this deprecation. It is important to understand the use case of toPromise()
, why this particular method is available, and when to use it. Additionally, it is important to understand the incoherent behavior of this method in RxJS 6 in order to anticipate problems that might arise.
Promises are used by many developers nowadays, and there are thousands of promise-based libraries. A promise is an object that holds the result (or failure) of an asynchronous operation.
Promises have been available in JavaScript through third-party libraries such as jQuery. Additionally, ECMAScript 6 added built-in support to JavaScript for promises...