From b8a0aa99662d3e841ffe4bcca707770449aa7f58 Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Fri, 29 Jun 2018 16:09:13 -0700 Subject: [PATCH] update code sample in redux router engine doc (#845) --- .../advanced/stand-alone-modules/redux-router-engine.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/chapter1/advanced/stand-alone-modules/redux-router-engine.md b/docs/chapter1/advanced/stand-alone-modules/redux-router-engine.md index b6adb7694..5af1940ff 100644 --- a/docs/chapter1/advanced/stand-alone-modules/redux-router-engine.md +++ b/docs/chapter1/advanced/stand-alone-modules/redux-router-engine.md @@ -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); }; ```