diff options
Diffstat (limited to 'packages/gitbook-core/src/reducers/summary.js')
-rw-r--r-- | packages/gitbook-core/src/reducers/summary.js | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/packages/gitbook-core/src/reducers/summary.js b/packages/gitbook-core/src/reducers/summary.js index 60568ef..c20d27a 100644 --- a/packages/gitbook-core/src/reducers/summary.js +++ b/packages/gitbook-core/src/reducers/summary.js @@ -1,28 +1,6 @@ -const { Record, List } = require('immutable'); +const StateSummary = require('../models/StateSummary'); -const File = require('../models/File'); -const SummaryPart = require('../models/SummaryPart'); - - -class SummaryState extends Record({ - file: new File(), - parts: List() -}) { - constructor(state = {}) { - super({ - ...state, - file: new File(state.file), - parts: (new List(state.parts)) - .map(article => new SummaryPart(article)) - }); - } - - static create(state) { - return state instanceof SummaryState ? - state : new SummaryState(state); - } -} module.exports = (state, action) => { - return SummaryState.create(state); + return StateSummary.create(state); }; |