dependency upgrades, server and platform module updates, linting wip

This commit is contained in:
William Welling
2017-07-12 14:33:16 -05:00
parent afc39022f8
commit c08f5c672b
190 changed files with 6321 additions and 4703 deletions

43
src/app/app.reducer.ts Normal file
View File

@@ -0,0 +1,43 @@
import { combineReducers, ActionReducer } from "@ngrx/store";
import { routerReducer, RouterState } from "@ngrx/router-store";
import { headerReducer, HeaderState } from './header/header.reducer';
import { hostWindowReducer, HostWindowState } from "./shared/host-window.reducer";
import { CoreState, coreReducer } from "./core/core.reducers";
import { storeFreeze } from 'ngrx-store-freeze';
import { compose } from "@ngrx/core";
import { StoreActionTypes } from "./store.actions";
import { ENV_CONFIG } from '../config';
export interface AppState {
core: CoreState;
router: RouterState;
hostWindow: HostWindowState;
header: HeaderState;
}
export const reducers = {
core: coreReducer,
router: routerReducer,
hostWindow: hostWindowReducer,
header: headerReducer
};
export function rootReducer(state: any, action: any) {
switch (action.type) {
case StoreActionTypes.REHYDRATE:
state = Object.assign({}, state, action.payload);
break;
case StoreActionTypes.REPLAY:
break;
default:
}
let root: ActionReducer<any>;
// TODO: attempt to not use InjectionToken GLOBAL_CONFIG over GlobalConfig ENV_CONFIG
if (ENV_CONFIG.production) {
root = combineReducers(reducers)(state, action);
} else {
root = compose(storeFreeze, combineReducers)(reducers)(state, action);
}
return root;
}