This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const customerFeatureKey = 'Customer'; | |
export interface State {customers: Customer[]} | |
export interface CustomerAppState { | |
[customerFeatureKey]: State; | |
} | |
export const initialState: State = {customers: []}; | |
export const customerReducer = createReducer<State>( | |
initialState, | |
on(CustomerActions.loaded, (state, { customers }) => ({...state, customers})), | |
on(CustomerActions.added, (state, { customers }) => ({...state, customers})), | |
on(CustomerActions.updated, (state, { customers }) => ({...state, customers})), | |
on(CustomerActions.removed, (state, { customers }) => ({...state, customers})) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment