Skip to content

Commit

Permalink
update code sample in redux router engine doc (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jun 29, 2018
1 parent 8569a8c commit b8a0aa9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,14 @@ import ReduxRouterEngine from "electrode-redux-router-engine";
import { routes } from "../client/routes";
import CreateReduxStore from "./createReduxStore";

let routesEngine;

module.exports = req => {
if (!req.server.app.routesEngine) {
req.server.app.routesEngine = new ReduxRouterEngine({ routes });
if (!routesEngine) {
routesEngine = new ReduxRouterEngine({ routes });
}

return req.server.app.routesEngine.render(req);
return routesEngine.render(req);
};
```

Expand Down

0 comments on commit b8a0aa9

Please sign in to comment.