Angular 2+ and Redux

22 views
Skip to first unread message

Hervé Le Cornec

unread,
Oct 23, 2019, 9:47:38 AM10/23/19
to Angular and AngularJS discussion
Hello,

I see many project that embed Redux with Angular, and I do not understand why.

I am using a lot Angular, see for instance my last creation (Angular 7) www.oceanvirtuel.eu, which is a rich and very complex app. I am using a store of course, but I build it with a simple native service of Angular. With such a service I share the store between many components, and any change from the DOM or the script, in one component is natively propagated to all other components, and this is actually what the two-way data binding is all about. In real time a dump of my store gives me the instant state of my application (that I all drive to the server to be backuped for instance).

Therefore can you explain me the advantage to break the native two-way data binding of Angular with Redux ?

Thank you in advance.

Sander Elias

unread,
Oct 23, 2019, 10:10:08 AM10/23/19
to Angular and AngularJS discussion
Hi Hervé,

There is no need for native redux in an Angular app. It solves a problem Angular doesn't have.
However, as often in our trade, some things are hype-driven. There is never a real need for redux in an Angular app. Still, there are benefits. When you are in a large mixed team, redux makes sure all API is designed the same way. This makes it much easier to onboard new members to a team. For some enterprises, this might be worth the additional complexity. (there are more benefits, but this is the main one)

Regards
Sander

Hervé Le Cornec

unread,
Oct 24, 2019, 2:43:21 AM10/24/19
to Angular and AngularJS discussion
Hello Sander,

Thank you for your answer.

I agree wth you. However in my sens there are other ways to be sure that all the APIs are designed the same way, without embedding Redux. Using the best practices of Angular for instance, instead of learning Redux first, and then using its best practices. Furthermore I am not sure that Redux makes much easier to onboard new members to a team, because using the pure Angular I will need someone who has the Angular skills only, using Redux I will need someone who has the same Angular skills, but also a good knowledge of Redux. This second guy will then be harder to find, and will cost more.

You know, the complexity is mathematically defined as the number of complexions of the sub system included in a global system. For N sub-system the complexity is factorial N : N!. So adding a useless library to a dev project will mathematically increase the complexity, so the probability of bugs, increase the delays, so the cost, etc.

I am a freelance, so I visit a lot of companies. The last time I re-writed a code in 2 days, in pure Angular but no Redux, that was coded first by 3 devs in one and a half month, using Redux. The difference is as drastic as this.

Cheers
Herve
Reply all
Reply to author
Forward
0 new messages