mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
21 lines
750 B
TypeScript
21 lines
750 B
TypeScript
/// <reference path="./react-router-redux-2.x.d.ts" />
|
|
/// <reference path="../redux/redux.d.ts" />
|
|
/// <reference path="../react-router/react-router.d.ts" />
|
|
|
|
|
|
|
|
import { createStore, combineReducers, applyMiddleware } from 'redux';
|
|
import { browserHistory } from 'react-router';
|
|
import { syncHistory, routeReducer } from 'react-router-redux';
|
|
|
|
const reducer = combineReducers({ routing: routeReducer });
|
|
|
|
// Sync dispatched route actions to the history
|
|
const reduxRouterMiddleware = syncHistory(browserHistory);
|
|
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore);
|
|
|
|
const store = createStoreWithMiddleware(reducer);
|
|
|
|
// Required for replaying actions from devtools to
|
|
reduxRouterMiddleware.listenForReplays(store);
|