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')
)
componentWillMount() {
const { dispatch, user } = this.props;
if (!user) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillReceiveProps(nextProps) {
const { dispatch } = this.props;
if (nextProps.success && nextProps.ownUserId) {
dispatch(pushState(null, '/'));
}
}
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);