import { createSelector } from 'reselect' ; import { storeLogger } from "ngrx-store-logger" ; import * as fromLayout from "./layout/layout.reducer" ; import * as fromGames from "./games/games.reducer" ; import { compose } from "@ngrx/core" ; import { combineReducers , State } from "@ngrx/store" ; import { state } from "@angular/core" ; export interface AppState { layout : fromLayout . State ; games : fromGames . State ; } export const reducers = { layout : fromLayout . reducer , games : fromGames . reducer } ; const developmentReducer = compose ( storeLogger ( ) , combineReducers ) ( reducers ) ; export function metaReducer ( state , action ) { return developmentReducer ( state , action ) ; } /**
 * Layout selectors
 */ export const getLayoutState = ( state ) => state . layout ; export const getLayoutOpenedModalName = createSelector ( getLayoutState , fromLayout . getOpenedModalName ) ; export const getLayoutLeftSidenavState = createSelector ( getLayoutState , fromLayout . getLeftSidenavState ) ; export const getLayoutRightSidenavState = createSelector ( getLayoutState , fromLayout . getRightSidenavState ) ; export const getLayoutAlertsState = createSelector ( getLayoutState , fromLayout . getAlerts ) ; export const getGamesState = ( state ) => state . games ; export const getGamesEntities = createSelector ( getGamesState , fromGames . getEntities ) ; export const getGamesCount = createSelector ( getGamesState , fromGames . getCount ) ; export const getGamesPage = createSelector ( getGamesState , fromGames . getPage ) ; export const getGamesLoadingState = createSelector ( getGamesState , fromGames . getLoadingState ) ;