How to use the connected-react-router/immutable.connectRouter function in connected-react-router

To help you get started, we’ve selected a few connected-react-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 jackdh / RasaTalk / app / reducers.js View on Github external
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    global: globalReducer,
    form: formReducer,
    language: languageProviderReducer,
    ...injectedReducers,
  });
  // Wrap the root reducer and return a new root reducer with router state
  const mergeWithRouterState = connectRouter(history);
  return mergeWithRouterState(rootReducer);
}
github ilhammeidi / dandelion-starter / app / redux / reducers.js View on Github external
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    form,
    login,
    ui: uiReducer,
    initval,
    language: languageProviderReducer,
    router: connectRouter(history),
    ...injectedReducers,
  });

  // Wrap the root reducer and return a new root reducer with router state
  const mergeWithRouterState = connectRouter(history);
  return mergeWithRouterState(rootReducer);
}
github danactive / history / ui / app / reducers.js View on Github external
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    global: globalReducer,
    language: languageProviderReducer,
    ...injectedReducers,
  });

  // Wrap the root reducer and return a new root reducer with router state
  const mergeWithRouterState = connectRouter(history);
  return mergeWithRouterState(rootReducer);
}
github curioswitch / curiostack / common / web / base-web / src / state / store.ts View on Github external
export default function configureStore<s>(
  initialState: S,
  history: History,
): InjectableStore {
  const nonInjectedReducers = {
    language: languageProviderReducer as Reducer,
    router: connectRouter(history) as Reducer,
  };

  // Create the store with two middlewares
  // 1. sagaMiddleware: Makes redux-sagas work
  // 2. routerMiddleware: Syncs the location/URL path to the state
  const middlewares = [sagaMiddleware, routerMiddleware(history)];

  const enhancers = [applyMiddleware(...middlewares)];

  const windowCast = window ? (window as any) : null;

  // If Redux DevTools Extension is installed use it, otherwise use Redux compose
  const composeEnhancers =
    process.env.NODE_ENV !== 'production' &amp;&amp;
    windowCast &amp;&amp;
    // eslint-disable-next-line no-underscore-dangle</s>
github danactive / history / ui / internals / templates / reducers.js View on Github external
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    language: languageProviderReducer,
    ...injectedReducers,
  });

  // Wrap the root reducer and return a new root reducer with router state
  const mergeWithRouterState = connectRouter(history);
  return mergeWithRouterState(rootReducer);
}
github draftapps / frontend / app / reducers.js View on Github external
export default function createReducer(injectedReducers = {}) {
  const rootReducer = combineReducers({
    language: languageProviderReducer,
    ...injectedReducers,
  });

  // Wrap the root reducer and return a new root reducer with router state
  const mergeWithRouterState = connectRouter(history);
  return mergeWithRouterState(rootReducer);
}
github secret-tech / frontend-boilerplate / src / redux / configureStore.js View on Github external
const configureStoreDev = () => {
  const middlewares = [
    sagaMiddleware,
    routerMiddleware(history),
    loggerMiddleware
  ];

  const store = createStore(
    connectRouter(history)(rootReducer),
    initialState,
    applyMiddleware(...middlewares)
  );

  if (module.hot) {
    module.hot.accept('./rootReducer', () => {
      const nextReducer = require('./rootReducer').default;
      store.replaceReducer(nextReducer);
    });
  }

  sagaMiddleware.run(rootSaga);

  return store;
};
github red-gold / react-social-network / src / store / reducers / rootReducer.ts View on Github external
export const rootReducer = (history: any) => combineReducers({
    locale,
    imageGallery: imageGalleryReducer,
    post: postReducer,
    circle: circleReducer,
    comment: commentReducer,
    vote: voteReducer,
    server: serverReducer,
    authorize: authorizeReducer,
    router: connectRouter(history),
    user: userReducer,
    notify: notificationReducer,
    global: globalReducer
  } as any)
github hahoocn / react-mobile-boilerplate / src / reducers.js View on Github external
const rootReducer = history => combineReducers({
  router: connectRouter(history),
  home,
});
github gilmarsquinelato / i18n-manager / renderer / config / redux.ts View on Github external
export default (history: History) => {
  const sagaMiddleware = createSagaMiddleware();

  const enhancer = composeWithDevTools(applyMiddleware(
    sagaMiddleware,
    routerMiddleware(history),
  ));

  const store = createStore(
    connectRouter(history)(rootReducer),
    enhancer,
  );
  let sagaTask = sagaMiddleware.run(rootSaga);

  const hot = (module as any).hot;
  if (hot) {
    hot.accept('./rootReducer', () => {
      const reducer = require('./rootReducer').default;
      store.replaceReducer(connectRouter(history)(reducer));
    });

    hot.accept('./rootSaga', () => {
      sagaTask.cancel();
      sagaTask.done.then(() => {
        sagaTask = sagaMiddleware.run(require('./rootSaga').default);
      });