복붙노트

[ANGULAR] Angular 6 / Ngrx 결합 감속기

ANGULAR

Angular 6 / Ngrx 결합 감속기

해결법


  1. 1.

    import { ActionReducerMap } from '@ngrx/store';
    import { reducer as counterReducer, key as counterKey } from './counter';
    import { reducer as profileReducer, key as profileKey } from './profile';
    
    export interface IAppState {
      [counterKey]: any;
      [profileKey]: any;
    }
    
    export const reducers: ActionReducerMap<IAppState> = {
      [counterKey]: counterReducer,
      [profileKey]: profileReducer,
    };
    
  2. from https://stackoverflow.com/questions/50804289/angular-6-ngrx-combine-reducers by cc-by-sa and MIT license