DEV Community

Discussion on: The Famous Misconceptions in Angular

Collapse
 
vugar005 profile image
Vugar • Edited

Hi. Thanks for comment. This is one of the things I pointed there, even though projects not using Angular, they are using Typescript and it getting more popular. Even Vuejs switched to full Typescript. Many folks who were critizing Angular for using Typescript, they are now happily using Typescript with React or Vuejs. Regarding, RxJs yes, it has learning curve. But what is alternative of that? Promises, thunk, Redux saga? Unfortunately all comes with cost. RxJs takes time to learn and master but as a result the code is neat, easy to read and flexible which is crucial in long term projects. Please see newly added screenshots on post. In addition, you are not obliged to use RxJs, you can convert it to Promise any time with from operator but I haven't seen anyone to prefer promises by giving up RxJs powerful opeators.

Collapse
 
dylanesque profile image
Michael Caveney

You can write async code just fine without a complicated library like Redux Saga or RxJS. RxJS really shines when you have to combine or pick through data in a certain way, but it's total overkill as the base data-fetching paradigm for Angular.

Thread Thread
 
vugar005 profile image
Vugar

Well in that case don't use RxJs in case of feeling overkill. It is totally fine, but you never know, requirements are rapidly changing so you end up refactoring to RxJs or other libraries.

Thread Thread
 
shaijut profile image
Shaiju T • Edited

In some Angular tutorials, RxJs is used to make simple http call to API. Is the purpose RxJs is just to make Ajax call or there any particular use case to switch to RxJs?

By the way, Below RxJs video made it simple to understand.

youtube.com/watch?v=eUYigtm3Sdc

Thread Thread
 
vugar005 profile image
Vugar

I just updated the blog, with and without RxJs example. Thanks.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
vugar005 profile image
Vugar • Edited

Hi Michael, you can convert Angular HTTP to Promise . See getData method in stackblitz.com/edit/rxjs-vs-promis...
Also developers are not obliged to use http, you can use fetch or some techiques. Http just adds additional useful features.

Thread Thread
 
lyrod profile image
Lyrod

It is really good to use angular http api (rxjs observable) when you want the ability to cancel any request by unsubscribing the subscription

Thread Thread
 
dylanesque profile image
Michael Caveney

The async pipe IS extremely nice

Thread Thread
 
lyrod profile image
Lyrod

Indeed