Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pure Redux VS ngrx with Angular

What are the pro and cons of using either pure Redux or ngrx with Angular2/4?

I have been using both in differenet projects but am still wondering which one is the most efficient and fastest.

like image 787
David Lasry Avatar asked Nov 18 '22 18:11

David Lasry


1 Answers

It ends up that ngrx and Redux follows mostly the same ideas and help solving pretty much the same issues.

That said, angular uses Rxjs a lot, specially Observables, and as ngrx is also built upon Rxjs, the integration is a little bit easier and smoother

Regarding performance, if there is a component for which the entire state is in store, and the async pipe is used to output data to the view, you may use another change detection strategy for this component and this may lead to a performance improvement, specially on large applications. You may do it by setting changeDetection to ChangeDetectionStrategy.OnPush on @Component decorator. You may find more information on that here.

Also, on this thread you may find a detailed discussion on ngrx/store vs Redux.

like image 84
GCSDC Avatar answered Dec 07 '22 06:12

GCSDC