Skip to content

Instantly share code, notes, and snippets.

@tomchentw
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save tomchentw/9afb40c8ffec3eee3df6 to your computer and use it in GitHub Desktop.

Select an option

Save tomchentw/9afb40c8ffec3eee3df6 to your computer and use it in GitHub Desktop.
Redux-Universal - Code Sections - 1
// http://git.io/v3Itp
// our routes returns a factory function, pass in the Redux store to initialize it
const routes = require("./routes")(store);
// create server-side location from the request instance provided by express
const location = new Location(request.path, request.query);
// promisified version of Router.run to resolve components for a given location
return runRouter(routes, location).then(([routerState, transition]) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment