0

I used Angular 1 and React / Redux, and one thing I like about React / Redux is that there is a definite app state, and a middleware that can convert a promise into real data.

In Angular 1, we often said, either have some sort of data in the top most controller, or in a parent controller, or by a service object, and people have different opinions, and things go in any direction. There was also no middleware for a promise to be converted to real data, ready to be used by the reducer.

Does Angular2 or Angular4 have something similar or better?

1 Answer 1

-2

This is a great read, from angular 2 team on how angular 2 handles state storage.

https://www.google.si/search?q=do+you+need+store+angular+2&rlz=1C1AVNE_enSI651SI651&oq=do+you+need+store+angular+2&aqs=chrome..69i57.3536j0j4&sourceid=chrome&ie=UTF-8

To summarize, you can use ngrx in Angular 2/4 just like you can in redux, react. But you might not need to. Angular 2 offers singleton services, which can do the job of a store just as well. Rember, dependancy injection and services can do a lot of things, like storing data, moving it from component to component, you just have to manage this yourself. Toy with observables and subjects.There is a lot you can do.

But if youre used to the "store", go ahead and include ngrx in your project

I'm not sure what you mean with reducer that converts a promise to real data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.