index.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
28
29
30
import * as persistState from 'redux-localstorage';
import * as createLogger from 'redux-logger';
import { IAppState, rootReducer, deimmutify, reimmutify } from './store';
import { ICourseField, ICourseFields } from './coursefields/coursefields.types';

export {
  IAppState,
  rootReducer,
  ICourseField,
  ICourseFields,
  reimmutify,
};

export const middleware = [
  createLogger({
    level: 'info',
    collapsed: true,
    stateTransformer: deimmutify
  })
];

export const enhancers = [
  persistState(
    '', {
      key: 'e-epal',
//      serialize: s => JSON.stringify(deimmutify(s)),
      serialize: s => JSON.stringify(s),
      deserialize: s => reimmutify(JSON.parse(s)),
  })
];