Files
DefinitelyTyped/react-router-redux/react-router-redux-2.x-tests.ts
2016-05-10 12:22:25 -07:00

21 lines
663 B
TypeScript

/// <reference types="redux" />
/// <reference types="react-router" />
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);