store.ts 964 Bytes
Newer Older
1
2
import { combineReducers } from 'redux';
import * as courseFields from './coursefields';
3
import * as regions from './regionschools';
4
import * as studentDataFields from './studentdatafields';
5
6
7
8
9
10
11

/*
 * This is where we 'assemble' the full store out of its modules.
 */

export interface IAppState {
    courseFields?: courseFields.ICourseFields;
12
    regions?: regions.IRegions;
13
    studentDataFields?: studentDataFields.IStudentDataFields;
14
15
16
17
};

export const rootReducer = combineReducers<IAppState>({
   courseFields: courseFields.courseFieldsReducer,
18
   regions: regions.regionSchoolsReducer,
19
   studentDataFields: studentDataFields.studentDataFieldsReducer,
20
21
22
23
});

export function deimmutify(state: IAppState): Object {
  return {
24
    courseFields: courseFields.deimmutifyCourseFields(state.courseFields),
25
    regions: regions.deimmutifyRegionSchools(state.regions),
26
    studentdataFields: studentDataFields.deimmutifyStudentDataFields(state.studentDataFields),
27
28
  };
}