Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (isClientSide) {
const sagaMiddleware = createSagaMiddleware()
const finalCreateStore = compose(
applyMiddleware(sagaMiddleware),
applyMiddleware(routerMiddleware(browserHistory)),
window.devToolsExtension ? window.devToolsExtension() : f => f
)(createStore)
const store = createKeaStore(finalCreateStore, appReducers)
sagaMiddleware.run(createRootSaga(appSaga))
const history = syncHistoryWithStore(browserHistory, store)
// TODO: check why do we need to do this?
match({routes: getRoutes(Layout, store, routes), location: railsContext.location}, () => {})
store.dispatch(initFromProps(props))
// custom scenes
store.addKeaScene(headerScene, true)
return (
)
} else {
// we aren't using this at the moment
}
}
const store = createKeaStore(finalCreateStore, appReducers)
sagaMiddleware.run(createRootSaga(appSaga))
const history = syncHistoryWithStore(browserHistory, store)
// TODO: check why do we need to do this?
match({routes: getRoutes(Layout, store, routes), location: railsContext.location}, () => {})
store.dispatch(initFromProps(props))
// custom scenes
store.addKeaScene(headerScene, true)
return (
)
} else {
// we aren't using this at the moment
}
}