static-cms/src/routing/history.js

16 lines
394 B
JavaScript
Raw Normal View History

2016-07-15 15:05:04 -03:00
import { createHistory } from 'history';
import { useRouterHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
2016-07-15 16:16:33 -03:00
import basePath from './basePath';
2016-07-15 15:05:04 -03:00
let history = useRouterHistory(createHistory)({
2016-07-15 16:16:33 -03:00
basename: basePath
2016-07-15 15:05:04 -03:00
});
const syncHistory = (store) => {
history = syncHistoryWithStore(history, store);
};
export { syncHistory };
export default history;