1 | import { browserHistory } from 'react-router'
|
2 | import { routerReducer, routerMiddleware } from 'react-router-redux'
|
3 | import thunk from 'redux-thunk'
|
4 | import {
|
5 | reducer as realtimeLocationReducer,
|
6 | REALTIME_LOCATION_REDUCER_NAME,
|
7 | } from './realtime-location'
|
8 | import { SERVER_REDUCER_NAME, serverReducer } from '../ReactApp/server/redux'
|
9 | import {
|
10 | reducerLocaleId as i18nReducerLocaleId,
|
11 | reducerLocales as i18nReducerLocales,
|
12 | } from '../i18n/redux'
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export const reducers = {
|
20 |
|
21 | 'routing': routerReducer,
|
22 |
|
23 | [REALTIME_LOCATION_REDUCER_NAME]: realtimeLocationReducer,
|
24 |
|
25 | [SERVER_REDUCER_NAME]: serverReducer,
|
26 | }
|
27 | if (JSON.parse(process.env.KOOT_I18N) || false) {
|
28 | reducers.localeId = i18nReducerLocaleId
|
29 | reducers.locales = i18nReducerLocales
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export let initialState = {}
|
38 | if (__CLIENT__) initialState = window.__REDUX_STATE__
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export const middlewares = [
|
46 | thunk,
|
47 | routerMiddleware(browserHistory),
|
48 | ]
|