DEV Community


Angular 6 NgRx Store example – Angular State Management

javasampleapproach profile image JavaSampleApproach ・1 min read

NgRx Store is a state management solution for Angular apps that helps us build applications by working around our app’s data (state). In this tutorial, we’re gonna look at how to work with NgRx Store, custom Actions, Reducers. Then we will practice to understand all of them in a simple practical Angular 6 example.

Why we need a State container
State container helps JavaScript applications to manage state.
=> Whenever we wanna read the state, look into only one single place – NgRx Store.
=> Managing the state could be simplified by dealing with simple objects and pure functions.

NgRx Store
Store holds the current state so that we can see it as a single source of truth for our data.
– access state using (property is defined at app.module.ts in StoreModule.forRoot()).
– update state via store.dispatch(action).

All tutorial at:

Related posts:

Discussion (0)

Editor guide