Created
May 12, 2017 08:01
-
-
Save anteburazer/25d684f0a5a4650eaa731367511503b7 to your computer and use it in GitHub Desktop.
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 interface State { | |
products: fromProducts.State; | |
login: fromAuth.State; | |
} | |
const reducers = { | |
products: fromProducts.reducer, | |
login: fromAuth.reducer | |
}; | |
export function store(state: any, action: any) { | |
const store: ActionReducer<State> = compose(combineReducers)(reducers); | |
return store(state, action); | |
} | |
export const getLoginState = (state: State) => state.login; | |
export const getLoginLoaded = createSelector(getLoginState, fromAuth.getLoaded); | |
export const getLoginLoading = createSelector(getLoginState, fromAuth.getLoading); | |
export const getLoginFailed = createSelector(getLoginState, fromAuth.getFailed); | |
export const getLoggedUser = createSelector(getLoginState, fromAuth.getLoggedUser); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment