1 | import { routerReducer, routerMiddleware } from 'react-router-redux'
|
2 | import thunk from 'redux-thunk'
|
3 | import {
|
4 | reducer as realtimeLocationReducer,
|
5 | REALTIME_LOCATION_REDUCER_NAME,
|
6 | } from './realtime-location'
|
7 | import { SERVER_REDUCER_NAME, serverReducer } from '../ReactApp/server/redux'
|
8 | import {
|
9 | reducerLocaleId as i18nReducerLocaleId,
|
10 |
|
11 | } from '../i18n/redux'
|
12 | import isI18nEnabled from '../i18n/is-enabled'
|
13 |
|
14 | import history from "./history"
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export const reducers = {
|
28 |
|
29 | 'routing': routerReducer,
|
30 |
|
31 | [REALTIME_LOCATION_REDUCER_NAME]: realtimeLocationReducer,
|
32 |
|
33 | [SERVER_REDUCER_NAME]: serverReducer,
|
34 | }
|
35 | if (isI18nEnabled()) {
|
36 | reducers.localeId = i18nReducerLocaleId
|
37 |
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export const initialState = (() => {
|
46 | if (__CLIENT__) return window.__REDUX_STATE__
|
47 | if (__SERVER__) return {}
|
48 | })()
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export const middlewares = [
|
56 | thunk,
|
57 | routerMiddleware(history),
|
58 | ]
|