Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { createStore, compose, applyMiddleware } from 'redux'
import reducers from 'reducers'
import { reduxReactRouter } from 'redux-router'
import createHistory from 'history/lib/createBrowserHistory' // history/lib/createHashHistory
import thunk from 'redux-thunk'
const finalCreateStore = compose(
applyMiddleware(thunk),
reduxReactRouter({ createHistory })
)(createStore)
export default function configureStore (initialState) {
const store = finalCreateStore(reducers, initialState)
return store
}
import Routes from './routes'
import createHistory from 'history/lib/createBrowserHistory'
import drone from './reducers/drone'
import { createStore, compose, combineReducers } from 'redux'
import { Provider } from 'react-redux'
// Grab the state from a global injected into server-generated HTML
const initialState = window.__INITIAL_STATE__
const reducer = combineReducers({
router: routerStateReducer,
drone
})
let store = compose(
reduxReactRouter({ createHistory }) //, devTools()
)(createStore)(reducer, initialState)
ReactDOM.render(
{Routes}
,
document.getElementById('container')
)
import { createStore, applyMiddleware,compose } from 'redux'
import { reduxReactRouter } from 'redux-router'
import routes from '../config/routes'
import thunk from 'redux-thunk'
import reducer from '../reducers/index'
import createHistory from 'history/lib/createBrowserHistory'
import createLogger from 'redux-logger'
const finalCreateStore = compose(
applyMiddleware(thunk),
reduxReactRouter({routes, createHistory})
)(createStore);
export default function configureStore(initialState) {
return finalCreateStore(reducer, initialState)
}
import { createStore, applyMiddleware, compose } from 'redux';
import { reduxReactRouter } from 'redux-router';
import { createHistory } from 'history';
import thunk from 'redux-thunk';
import rootReducer from 'reducers/rootReducer';
const createStoreWithMiddleware = compose(
applyMiddleware(thunk),
reduxReactRouter({ createHistory })
)(createStore);
export default function configureStore(initialState) {
return createStoreWithMiddleware(rootReducer, initialState);
}
const reducer = combineReducers({
router: routerStateReducer,
machine,
driver,
docker,
container,
image,
registry,
error,
httpRequest
});
export default compose(
applyMiddleware(thunkMiddleware, logger),
reduxReactRouter({ createHistory })
)(createStore)(reducer);
export default function createStore() {
return compose(
applyMiddleware(thunk),
reduxReactRouter({ createHistory: createHistoryWithBasename, routerStateSelector })
)(createReduxStore)(reducer);
};
export default function create() {
if (__DEVTOOLS__) {
return compose(
applyMiddleware(thunkMiddleware, reduxLogger()),
reduxReactRouter({ createHistory }),
DevTools.instrument()
)(createStore)(reducers);
}
return compose(
applyMiddleware(thunkMiddleware, reduxLogger()),
reduxReactRouter({ createHistory })
)(createStore)(reducers);
}
export default function renderRoutes (routes, reducers) {
const state = window.__initialState;
const store = configureStore(
reduxReactRouter({createHistory, routes}),
reducers,
state
);
render(
,
document.getElementById('view')
);
}
export default function configureStore (initialState, debug = false) {
let createStoreWithMiddleware;
const middleware = applyMiddleware(thunk);
if (debug) {
createStoreWithMiddleware = compose(
middleware,
reduxReactRouter({ routes, createHistory }),
DevTools.instrument()
);
} else {
createStoreWithMiddleware = compose(
middleware,
reduxReactRouter({ routes, createHistory })
);
}
const store = createStoreWithMiddleware(createStore)(
rootReducer, initialState
);
if (module.hot) {
module.hot.accept('../reducers', () => {
const nextRootReducer = require('../reducers/index');