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.
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.
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.
I am a Full stack .NET Developer, I like to work with C#, Asp.Net Core, SQL, Mongo DB, Azure, JavaScript...
Always eager to learn new technologies. I am here to share, ask & eventually learn.
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.
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.
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.
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.
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.
In some Angular tutorials,
RxJs
is used to make simplehttp
call toAPI
. Is the purposeRxJs
is just to makeAjax
call or there any particular use case to switch toRxJs
?By the way, Below
RxJs
video made it simple to understand.youtube.com/watch?v=eUYigtm3Sdc
I just updated the blog, with and without RxJs example. Thanks.
You cant uncouple RxJs from the Angular HTTP API.
You cant uncouple RxJs from the Angular HTTP API.
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.
It is really good to use angular http api (rxjs observable) when you want the ability to cancel any request by unsubscribing the subscription
The async pipe IS extremely nice
Indeed