Tuomas Toivonen
Tuomas Toivonen

Reputation: 23492

Redux and Angular 2

Is it approved to use Redux with Angular 2 for state management, or does Angular 2 provide some internal mechanism to manage the application state in a consistent way?

Upvotes: 10

Views: 836

Answers (5)

Alireza
Alireza

Reputation: 104680

We can use Angular with Redux, but the structure of Angular is different, it's better using services rather than using Redux with that...

But if you still like to use Redux with Angular, have a look at ng-redux, you can check it out here:

https://github.com/angular-redux/ng-redux

Also this is a good blog post about Angular Redux:

http://blog.rangle.io/managing-state-redux-angular

Upvotes: 0

Ariel Henryson
Ariel Henryson

Reputation: 1346

I think that the way we working in Angular 2 is little bit different from React, because in Angular we use services and components. I think that the principle of Redux is great but you need to apply it in a different way in Angular.

I wrote an article that offers a solution for that Angular 2 state store strategy (using RXBox)

Upvotes: 0

Andres Roget
Andres Roget

Reputation: 144

Angular 2 does not come with its own state management pattern nor does it enforces one in particular that being said its architecture follows React's approach very closely and as far as I know you have two ways to implement a Flux approach to your NG2 App, NgRx and Angular Redux.

Personally I have not used Angular Redux, as NgRx seems to be the most used and recommended solution, it is also quite easy to implement.

Upvotes: 0

Nige
Nige

Reputation: 1233

"Internally" it is not a bundled feature or module. But the guys @NGRX have done an absolutely fantastic job in supporting this pattern in angular2.

Take a look at these following resources for more details: https://github.com/ngrx/store

https://blog.sstorie.com/building-an-angular-2-reactive-auto-logout-timer-with-the-redux-pattern/

Upvotes: 8

Related Questions