├── .gitignore ├── .babelrc ├── src ├── reducers │ ├── index.js │ ├── Router.js │ └── info.js ├── api │ ├── routes │ │ ├── index.js │ │ └── loadInfo.js │ └── api.js ├── actions │ ├── actionTypes.js │ └── infoActions.js ├── components │ ├── index.js │ ├── MainMenu.js │ ├── App.js │ ├── InfoBar.js │ └── AppTreeFactory.js ├── views │ ├── index.js │ ├── Home.js │ ├── Error404NotFound.js │ ├── Another.js │ └── DefaultHeader.js ├── redux │ ├── thunkMiddleware.js │ ├── create.js │ └── clientMiddleware.js ├── config.js ├── client.js ├── router.js ├── ApiClient.js └── server.js ├── favicon.ico ├── babel.server.js ├── loaders.js ├── webpack.client.js ├── webpack.client-watch.js ├── README.md └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | static 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsxPragma": "element" 3 | } 4 | -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | export info from './info'; 2 | -------------------------------------------------------------------------------- /src/api/routes/index.js: -------------------------------------------------------------------------------- 1 | export loadInfo from './loadInfo'; 2 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nilsivanson/deku-redux-universal-hot-example/HEAD/favicon.ico -------------------------------------------------------------------------------- /src/actions/actionTypes.js: -------------------------------------------------------------------------------- 1 | export const INFO_LOAD = 'INFO_LOAD'; 2 | export const INFO_LOAD_SUCCESS = 'INFO_LOAD_SUCCESS'; 3 | export const INFO_LOAD_FAIL = 'INFO_LOAD_FAIL'; -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | export App from './App'; 2 | export AppTreeFactory from './AppTreeFactory'; 3 | export InfoBar from './InfoBar'; 4 | export MainMenu from './MainMenu'; 5 | -------------------------------------------------------------------------------- /src/views/index.js: -------------------------------------------------------------------------------- 1 | export DefaultHeader from './DefaultHeader'; 2 | export Home from './Home'; 3 | export Another from './Another'; 4 | export Error404NotFound from './Error404NotFound'; 5 | -------------------------------------------------------------------------------- /src/reducers/Router.js: -------------------------------------------------------------------------------- 1 | const initialState = {}; 2 | 3 | export default function Router(state = initialState, action = {}) { 4 | switch (action.type) { 5 | 6 | } 7 | return state; 8 | } 9 | -------------------------------------------------------------------------------- /src/api/routes/loadInfo.js: -------------------------------------------------------------------------------- 1 | export default function (req) { 2 | return new Promise(function (resolve) { 3 | resolve({ 4 | message: 'Hello from the API server', 5 | time: Date.now() 6 | }); 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /src/redux/thunkMiddleware.js: -------------------------------------------------------------------------------- 1 | export default function thunkMiddleware({ dispatch, getState }) { 2 | return (next) => (action) => 3 | typeof action === 'function' ? 4 | action(dispatch, getState) : 5 | next(action); 6 | } 7 | -------------------------------------------------------------------------------- /src/views/Home.js: -------------------------------------------------------------------------------- 1 | import {element} from 'deku'; 2 | import {InfoBar} from '../components/index'; 3 | 4 | function render({props}) { 5 | return ( 6 |
Note that the info bar state persists. It is stored in redux and whenever it changes it is pushed to currentReduxState. See client.js for more information.
9 |