Reputation: 91
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.
Upvotes: 7
Views: 2649
Reputation: 3500
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.
Upvotes: 3
Reputation: 307
ngrx/store was created specifically for Angular2. The detailed reasons can be found here:
https://github.com/ngrx/store/issues/16
Upvotes: -1