How to use the connected-react-router.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 apostolnikov / eventbrite-clone / client / src / store / store.ts View on Github external
function configureStore(initialState?: {}) {
	// configure middlewares
	const middlewares = [thunk, promise(), routerMiddleware(history)];
	// compose enhancers
	const enhancer = composeEnhancers(applyMiddleware(...middlewares));
	// create store
	return createStore(connectRouter(history)(rootReducer), persistedState || initialState!, enhancer);
}
github opentripplanner / otp-react-redux / example.js View on Github external
const history = createHashHistory()
const middleware = [
  thunk,
  routerMiddleware(history) // for dispatching history actions
]

// check if app is being run in development mode. If so, enable redux-logger
if (process.env.NODE_ENV === 'development') {
  middleware.push(createLogger())
}

// set up the Redux store
const store = createStore(
  combineReducers({
    otp: createOtpReducer(otpConfig),
    router: connectRouter(history)
  }),
  compose(applyMiddleware(...middleware))
)

// define a simple responsive UI using Bootstrap and OTP-RR
class OtpRRExample extends Component {
  render () {
    /** desktop view **/
    const desktopView = (
      <div>
        
          
            
              <div style="{{">
                
              </div></div>
github vocoWone / reaux / src / framework / core / App.tsx View on Github external
function createApp(): AppView {
    const history = createBrowserHistory();
    const actionStore = new ActionStore();
    const sagaMiddleware = createSagaMiddleware();
    const reducer: Reducer = rootReducer(connectRouter(history));
    const store: Store = createStore(reducer, devtools(applyMiddleware(routerMiddleware(history), sagaMiddleware)));
    store.subscribe(storeListener(store));
    sagaMiddleware.run(saga, actionStore);
    window.onerror = (message: string | Event, source?: string, line?: number, column?: number, error?: Error): void =&gt; {
        console.error("Window Global Error");
        console.error(`Message: ${message.toString()}`);
        if (error) {
            console.error(error);
        }
        if (source &amp;&amp; line &amp;&amp; column) {
            console.error(`Source: ${source} (${line}, ${column})`);
        }
        if (!error) {
            error = new Error(message.toString());
        }
        store.dispatch(setErrorAction(error));
github tomatau / breko-hub / scripts / starter-code / app / composition / root-reducer.js View on Github external
export default history => combineReducers({
  router: connectRouter(history),
})
github LeadcoinNetwork / Web-App-Project / frontend / src / storybook-utils / createStoreAndStory.js View on Github external
module.hot.accept("Reducers", function() {
      store.replaceReducer(connectRouter(history)(rootReducer))
    })
    if (module.hot) {
github Superjo149 / auryo / src / renderer / configureStore.tsx View on Github external
const configureStore = (): Store =&gt; {
    const store: Store = createStore(connectRouter(history)(rootReducer), enhancer);

    if (module.hot) {
        module.hot.accept('@common/store', () =&gt; {
            ipcRenderer.sendSync('renderer-reload');

            import('@common/store')
                .then(({ rootReducer }) =&gt; {
                    store.replaceReducer(connectRouter(history)(rootReducer) as any);
                });
        });
    }

    return store;
};
github ssteiger / Vyper-Contract-GUI / app / reducers / index.js View on Github external
export default function createRootReducer(history: History) {
  return combineReducers({
    router: connectRouter(history),
    accounts,
    settings,
    sidebar,
    selectedFile,
    files,
    functionCallResults,
  })
}
github GoogleChromeLabs / react-shrine / src / reducers.js View on Github external
export default history => combineReducers({
  router: connectRouter(history)
});
github project-slippi / slippi-desktop-app / app / reducers / index.js View on Github external
export default function createRootReducer(history) {
  return combineReducers({
    router: connectRouter(history),
    fileLoader: fileLoader,
    settings: settings,
    console: console,
    game: game,
    errors: errors,
    notifs: notifs
  });
}