import { ActionReducerMap , MetaReducer , ActionReducer , Action } from '@ngrx/store' ; import * as fromAuth from '../auth/store/auth.reducer' ; import * as fromAdmin from '../admin/store/admin.reducer' ; import { AuthState } from '../auth/store/auth.state' ; import { AdminState } from '../admin/store/admin.state' ; export interface AppState { auth : AuthState ; admin : AdminState ; } export const reducers = { auth : fromAuth . authReducer , admin : fromAdmin . adminReducer } ; export function clearState ( reducer ) { return function ( state , action ) : AppState { if ( action . type === '[Auth] LOGOUT completed' ) { state = undefined ; } return reducer ( state , action ) ; } ; } export const metaReducers = [ clearState ] ;