0
0
llucycodes42
This code is creating a reducer function. The reducer function takes two arguments, state and action. state is the current state of the reducer, and action is the action that was dispatched. The reducer function then returns a new reducer, which will take the current state and the action as input and return a new state.
Library: angular
Shortcut: a_ngrx_create_reducer
const featureReducer = createReducer(
initialState,
on(Actions.action, state => ({ ...state, prop: updatedValue })),
);
export function reducer(state: State | undefined, action: Action) {
return Reducer(state, action);
}