[Improvement] Change configure store export
This commit is contained in:
@@ -9,7 +9,7 @@ import registerServiceWorker from './registerServiceWorker'
|
|||||||
import config from 'src/config'
|
import config from 'src/config'
|
||||||
|
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
import store, { history } from 'store/configureStore'
|
import configureStore from 'store/configureStore'
|
||||||
import { ConnectedRouter } from 'react-router-redux'
|
import { ConnectedRouter } from 'react-router-redux'
|
||||||
|
|
||||||
// - Actions
|
// - Actions
|
||||||
@@ -21,10 +21,10 @@ import Master from 'components/master'
|
|||||||
|
|
||||||
// Set default data
|
// Set default data
|
||||||
// tslint:disable-next-line:no-empty
|
// tslint:disable-next-line:no-empty
|
||||||
store.subscribe(() => { })
|
configureStore.store.subscribe(() => { })
|
||||||
|
|
||||||
// - Initialize languages
|
// - Initialize languages
|
||||||
store.dispatch(localeActions.initTranslation())
|
configureStore.store.dispatch(localeActions.initTranslation())
|
||||||
|
|
||||||
// Needed for onClick
|
// Needed for onClick
|
||||||
// http://stackoverflow.com/a/34015469/988941
|
// http://stackoverflow.com/a/34015469/988941
|
||||||
@@ -47,8 +47,8 @@ import './socialEngine'
|
|||||||
|
|
||||||
const supportsHistory = 'pushState' in window.history
|
const supportsHistory = 'pushState' in window.history
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Provider store={store}>
|
<Provider store={configureStore.store}>
|
||||||
<ConnectedRouter history={history}>
|
<ConnectedRouter history={configureStore.history}>
|
||||||
<MuiThemeProvider theme={theme}>
|
<MuiThemeProvider theme={theme}>
|
||||||
<Master />
|
<Master />
|
||||||
</MuiThemeProvider>
|
</MuiThemeProvider>
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ let store: redux.Store<any> = redux.createStore(rootReducer, initialState, redux
|
|||||||
(window as any).devToolsExtension ? (window as any).devToolsExtension() : (f: any) => f
|
(window as any).devToolsExtension ? (window as any).devToolsExtension() : (f: any) => f
|
||||||
))
|
))
|
||||||
|
|
||||||
export default store
|
export default {store, history}
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ let store: redux.Store<any> = redux.createStore(rootReducer, initialState, redux
|
|||||||
(window as any).devToolsExtension ? (window as any).devToolsExtension() : (f: any) => f
|
(window as any).devToolsExtension ? (window as any).devToolsExtension() : (f: any) => f
|
||||||
))
|
))
|
||||||
|
|
||||||
export default store
|
export default {store, history}
|
||||||
|
|||||||
Reference in New Issue
Block a user