store.ts 698 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { combineReducers } from 'redux';
import * as courseFields from './coursefields';

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

export interface IAppState {
    courseFields?: courseFields.ICourseFields;
};

export const rootReducer = combineReducers<IAppState>({
   courseFields: courseFields.courseFieldsReducer,
});

export function deimmutify(state: IAppState): Object {
  return {
//    courseFields: courseFields.deimmutifyCourseFields(state.courseFields),
    courseFields: state.courseFields,
  };
}

export function reimmutify(plain): IAppState {
  return plain ? {
    courseFields: courseFields.reimmutifyCourseFields(plain.courseFields),
  } : {};
}