Skip to content

Instantly share code, notes, and snippets.

@anteburazer
Created May 12, 2017 08:01
Show Gist options
  • Save anteburazer/25d684f0a5a4650eaa731367511503b7 to your computer and use it in GitHub Desktop.
Save anteburazer/25d684f0a5a4650eaa731367511503b7 to your computer and use it in GitHub Desktop.
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