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

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

export interface IAppState {
    courseFields?: courseFields.ICourseFields;
11
    studentDataFields?: studentDataFields.IStudentDataFields;
12
13
14
15
};

export const rootReducer = combineReducers<IAppState>({
   courseFields: courseFields.courseFieldsReducer,
16
   studentDataFields: studentDataFields.studentDataFieldsReducer,
17
18
19
20
});

export function deimmutify(state: IAppState): Object {
  return {
21
    courseFields: courseFields.deimmutifyCourseFields(state.courseFields),
22
    studentdataFields: studentDataFields.deimmutifyStudentDataFields(state.studentDataFields),
23
24
25
  };
}

26
/* export function reimmutify(plain): IAppState {
27
28
  return plain ? {
    courseFields: courseFields.reimmutifyCourseFields(plain.courseFields),
29
    courseFieldsSelected: courseFieldsSelected.reimmutifyCourseFieldsSelected(plain.courseFieldsSelected),
30
  } : {};
31
} */