Reducers

Now that you've defined how this application's state can be modified, it's time to implement these actions in a reducer.

We'll cover the following

ngrx reducers

We need to define just how these state changes work. In state.ts, we’ll define the patient reducer, a function that handles the UPDATE_PATIENT and ADD_PATIENTS actions.

This application has only one type of state (an array of patients), but more complex apps have many different values stored in ngrx (user data, form elements, and the like).

Get hands-on with 1400+ tech skills courses.