0
1
JRJose Romero
The code creates a reducer function that takes two parameters: the initial state and an action. The reducer function will use the on() reducer function to handle the action. This on() function will take the action object and the current state and will return a new state. The new state will have the updatedValue property set to the value of the action object.
Library: angular
Shortcut: angular.ngrx.reducer
const featureReducer = createReducer(
initialState,
on(featureActions.action, state => ({ ...state, prop: updatedValue })),
);
export function reducer(state: State | undefined, action: Action) {
return featureReducer(state, action);
}