Hi Jen! Its always hard switching from one well known technology to other which works different, all the different patterns, idioms, approaches, community resources... It's a lot of stuff to process!
That being said many of the description of Angular in this article are imprecise or just incorrect which is easy to understand as the time spent with Angular vs React was considerably shorter ( i guess) and Angular was approached with Angular.js / React pre&existing know how which is not really that applicable.
eg: react does NOT have actions or reducers... Its the Redux library which provides these concepts...
Similarly Angular does not have actions or reducers but it has an NgRx library which is like upgraded redux.because it handles async and side-effects as first classconcepts
Hi Tomas, thanks for the thoughtful note. And yes good catch, actions and reducers are a Redux thing. In trying to compare like with like, the things I think are similar or different aren't actually there. It's such a stubborn thing to get used to one paradigm of module ecosystems, and certainly too easy for me to conflate the functionality of one set of tools with its availability in another. There's a lot that needs clarifying for sure.
To build off Thomasβs comment, ngrx is a set of related redux libraries built with Angular in mind, but at the end of the day, itβs just another redux library.
I would say that the βservice & providerβ approach you describe is not the best practice in Angular. Most articles I find recommend Redux for Angular just as they do for React.
NB: ngrx is fully compatible with React. It relies on RxJS observable, which work well with Reactβs...well, reactive, functional approach.
Hi Jen! Its always hard switching from one well known technology to other which works different, all the different patterns, idioms, approaches, community resources... It's a lot of stuff to process!
That being said many of the description of Angular in this article are imprecise or just incorrect which is easy to understand as the time spent with Angular vs React was considerably shorter ( i guess) and Angular was approached with Angular.js / React pre&existing know how which is not really that applicable.
eg: react does NOT have actions or reducers... Its the Redux library which provides these concepts...
Similarly Angular does not have actions or reducers but it has an NgRx library which is like upgraded redux.because it handles async and side-effects as first classconcepts
Wish you all the best on your learning journey
Bwahaha with useReducer(), vanilla React now has both actions and reducers. Watch out, tri-state area.
πππ
I have yet to try writing a project in react with just JS. Hmmmm
Hi Tomas, thanks for the thoughtful note. And yes good catch, actions and reducers are a Redux thing. In trying to compare like with like, the things I think are similar or different aren't actually there. It's such a stubborn thing to get used to one paradigm of module ecosystems, and certainly too easy for me to conflate the functionality of one set of tools with its availability in another. There's a lot that needs clarifying for sure.
To build off Thomasβs comment, ngrx is a set of related redux libraries built with Angular in mind, but at the end of the day, itβs just another redux library.
I would say that the βservice & providerβ approach you describe is not the best practice in Angular. Most articles I find recommend Redux for Angular just as they do for React.
NB: ngrx is fully compatible with React. It relies on RxJS observable, which work well with Reactβs...well, reactive, functional approach.
If only ngrx was more promoted in React tutorials...