Last active
August 13, 2019 21:06
-
-
Save whisher/69a401f40e6534b1d7d7355de77f565e to your computer and use it in GitHub Desktop.
Ngrx combineReducers example
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
import { combineReducers } from '@ngrx/store'; | |
import { | |
userAddressesReducer, | |
UserAddressesState, | |
initialUserAddressesState | |
} from './user-addresses.reducer'; | |
import { | |
userProfileReducer, | |
UserProfileState, | |
initialUserProfileState | |
} from './user-profile.reducer'; | |
export interface UserState { | |
addresses: UserAddressesState; | |
profile: UserProfileState; | |
} | |
export const initialUserState: UserState = { | |
addresses: initialUserAddressesState, | |
profile: initialUserProfileState | |
}; | |
export const userReducer = combineReducers( | |
{ | |
addresses: userAddressesReducer, | |
profile: userProfileReducer | |
}, | |
initialUserState | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment