How to use the redux-router.reduxReactRouter function in redux-router

To help you get started, we’ve selected a few redux-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sky-uk / api-explorer / packages-legacy / apiexplorer-legacy / src / store / configureStore.prod.js View on Github external
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
}
github JakeGinnivan / Drone / src / app.js View on Github external
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')
)
github nextzen / nextzen.js / app / store / configureStore.prod.js View on Github external
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)
}
github weslleyaraujo / pokedux / src / store / configureStore.prod.js View on Github external
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);
}
github lawrence0819 / neptune-front / src / stores / store.ts View on Github external
const reducer = combineReducers({
  router: routerStateReducer,
  machine,
  driver,
  docker,
  container,
  image,
  registry,
  error,
  httpRequest
});

export default compose(
  applyMiddleware(thunkMiddleware, logger),
  reduxReactRouter({ createHistory })
)(createStore)(reducer);
github stevenhauser / i-have-to-return-some-videotapes / src / utils / createStore.js View on Github external
export default function createStore() {
  return compose(
    applyMiddleware(thunk),
    reduxReactRouter({ createHistory: createHistoryWithBasename, routerStateSelector })
  )(createReduxStore)(reducer);
};
github fdietz / whistler_news_reader / web / static / js / redux / create.js View on Github external
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);
}
github relax / relax / lib / client / helpers / render-routes.js View on Github external
export default function renderRoutes (routes, reducers) {
  const state = window.__initialState;
  const store = configureStore(
    reduxReactRouter({createHistory, routes}),
    reducers,
    state
  );

  render(
    
      
    ,
    document.getElementById('view')
  );
}
github dont-fear-the-repo / fear-the-repo / src / store / configureStore.js View on Github external
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');

redux-router

Redux bindings for React Router — keep your router state inside your Redux Store.

MIT
Latest version published 8 years ago

Package Health Score

57 / 100
Full package analysis