import {
  createFeatureSelector,
  createSelector,
  MetaReducer
} from '@ngrx/store';

import * as fromRouter from '@ngrx/router-store';

import { environment } from '@environments';

import * as AppState from './app/state';
import * as AppAuthenticationState from './authentication/state';

export interface State {
  appRouter: fromRouter.RouterReducerState<any>;
  app: AppState.State;
  appAuthentication: AppAuthenticationState.State;
}

export const metaReducers: MetaReducer<State>[] = !environment.production
  ? []
  : [];

export const AppSelector = AppState.selectors((state: State) => state.app);
export const AppAuthenticationSelector = AppAuthenticationState.selectors(
  (state: State) => state.appAuthentication
);
