What are the changes Angular 6  in RxJS6

Now Angular 6 is the latest release. In angular 6 not much changes has been done, Only some classed has been updated to regular method based on their dependence. Observable class, such as throwError() and forkJoin(). Below example you can get clear understanding what are changes in Rxjs 5 to RxJS 6.

First, let’s consider a service that uses forkJoin to make parallel API calls. The Angular 5/RxJS 5 code looked like this:

src/app/demo.service.ts:

 

To upgrade this to RxJS 6 syntax, we need to change it to the following:

Similarly, in an example component, we might have previously used Observable.throw() to re-throw an exception within the error callback of the Observable:

src/app/app.component.ts:

In RxJS 6, Observable.throw() has been replaced by throwError() which operates very similarly to its predecessor. We just need to update the import statement and the new method name:

src/app/app.component.ts:

Other changes are done. you can see the complete changes RxJS Document.

How to install angular 6 step by step
Date Pipe In Angular 6 with examples

Share this post

Post Comment