From c18de360ff30f35f461e9971802608155f4805a0 Mon Sep 17 00:00:00 2001 From: sviatoslav Date: Mon, 14 Jan 2019 14:07:54 +0200 Subject: [PATCH] Minor docs update --- server/compiler.js | 6 +++--- src/controller/middleware/rootReducer.js | 4 ++-- src/controller/store.js | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/compiler.js b/server/compiler.js index 1cfbe5b..f9ae576 100644 --- a/server/compiler.js +++ b/server/compiler.js @@ -6,7 +6,7 @@ const webpack = require('webpack'); const webpackConfig = require('../webpack.config.js'); // ----------------------------- -// STARTING APP COMPILATION PROCESS +// READING WEBPACK CONFIGURATION // ----------------------------- function webpackCompiler() { return new Promise((resolve, reject) => { @@ -29,13 +29,13 @@ function webpackCompiler() { } // ----------------------------- -// READING WEBPACK CONFIGURATION +// STARTING APP COMPILATION PROCESS // ----------------------------- const compile = () => { debug('Starting compiler.'); return Promise.resolve() - .then(() => webpackCompiler(webpackConfig)) + .then(() => webpackCompiler()) .then(() => { debug('Compilation completed successfully.'); }) diff --git a/src/controller/middleware/rootReducer.js b/src/controller/middleware/rootReducer.js index dcfe517..33f8838 100644 --- a/src/controller/middleware/rootReducer.js +++ b/src/controller/middleware/rootReducer.js @@ -1,10 +1,9 @@ -// root Redux reducers for Splite-Chunks mode, -// probably you would always need this import { combineReducers } from 'redux'; import { connectRouter } from 'connected-react-router'; import app from '../../modules/reducers'; import history from '../history'; +// root Redux reducer const makeRootReducer = asyncReducers => { return combineReducers({ ...asyncReducers, @@ -13,6 +12,7 @@ const makeRootReducer = asyncReducers => { }); }; +// Splite-Chunks environment, probably you would always need this export const injectReducer = (store, { key, reducer }) => { if (Object.hasOwnProperty.call(store.asyncReducers, key)) return; store.asyncReducers[key] = reducer; diff --git a/src/controller/store.js b/src/controller/store.js index 9043eab..3de63e9 100644 --- a/src/controller/store.js +++ b/src/controller/store.js @@ -5,6 +5,7 @@ import history from './history'; import { logger, makeRootReducer, sagaMiddleware as saga, rootSaga, runSaga } from './middleware'; +// creating the root store config const rootStore = () => { const middleware = []; @@ -19,12 +20,13 @@ const rootStore = () => { const enhancers = []; + // allow to use the redux browser plugin if (__DEV__ && window.__REDUX_DEVTOOLS_EXTENSION__) { enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__()); } // ====================================================== - // Store Instantiation and HMR Setup + // Store Instantiation // ====================================================== const store = createStore( makeRootReducer(), @@ -35,6 +37,7 @@ const rootStore = () => { ) ); + // saga injecting during code-splitting store.runSaga = runSaga; runSaga(rootSaga); store.asyncReducers = {};