1 | 'use strict';
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.page = page;
|
5 |
|
6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
7 |
|
8 |
|
9 |
|
10 | var _extend = require('extend');
|
11 |
|
12 | var _extend2 = _interopRequireDefault(_extend);
|
13 |
|
14 | var _gfsReactTools = require('gfs-react-tools');
|
15 |
|
16 | var _gfsReactTools2 = _interopRequireDefault(_gfsReactTools);
|
17 |
|
18 | var _model = require('./model');
|
19 |
|
20 | var _reduxThunk = require('redux-thunk');
|
21 |
|
22 | var _reduxThunk2 = _interopRequireDefault(_reduxThunk);
|
23 |
|
24 | var _immutable = require('immutable');
|
25 |
|
26 | var _immutable2 = _interopRequireDefault(_immutable);
|
27 |
|
28 | exports.Model = _model.Model;
|
29 |
|
30 | var _control = require('./control');
|
31 |
|
32 | exports.Control = _control.Control;
|
33 | exports.Sync = _control.Sync;
|
34 | exports.fetch = _control.fetch;
|
35 |
|
36 | var _view = require('./view');
|
37 |
|
38 | exports.View = _view.View;
|
39 |
|
40 | var _decorator = require('./decorator');
|
41 |
|
42 | exports.Action = _decorator.enumerable;
|
43 | exports.Noenumerable = _decorator.noenumerable;
|
44 |
|
45 | if (window && window.DM_STORE) {
|
46 | var __initData = {},
|
47 | dmStore = window.DM_STORE;
|
48 | for (var item in dmStore) {
|
49 | if (dmStore[item] instanceof Object) {
|
50 | __initData[item] = _immutable2['default'].fromJS(dmStore[item]);
|
51 | }
|
52 | }
|
53 | window.DM_STORE = __initData;
|
54 | }
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | function page() {
|
88 | var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
89 |
|
90 | if (opts && typeof opts.module === 'undefined') {
|
91 | opts = {
|
92 | module: opts
|
93 | };
|
94 | }
|
95 |
|
96 | opts.middleware = [_reduxThunk2['default']].concat(opts.middleware || []);
|
97 |
|
98 | if (opts.debug || typeof opts.debug == 'undefined' && location && location.port != '') {
|
99 | opts.middleware.push(require('redux-logger')());
|
100 | }
|
101 |
|
102 | var rtools = new _gfsReactTools2['default'](_extend2['default']({
|
103 |
|
104 | middleware: [],
|
105 |
|
106 | module: null,
|
107 |
|
108 | reducers: _model.getModels(),
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | container: 'root',
|
117 | debug: false
|
118 | }, opts));
|
119 |
|
120 |
|
121 |
|
122 | return rtools;
|
123 | } |
\ | No newline at end of file |