diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-10-04 18:32:31 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-10-04 18:32:31 +0200 |
commit | 16ca48b2c05dad0af4cec600cee69adcafcf255f (patch) | |
tree | 63c1e117c0cf4da989652bd8236375fc9ba3a094 /packages/gitbook-core/src/reducers/page.js | |
parent | 87ae2481e4e6f4c6c0756ae379c8c806d95cbb68 (diff) | |
download | gitbook-16ca48b2c05dad0af4cec600cee69adcafcf255f.zip gitbook-16ca48b2c05dad0af4cec600cee69adcafcf255f.tar.gz gitbook-16ca48b2c05dad0af4cec600cee69adcafcf255f.tar.bz2 |
Correctly update page when url changed
Diffstat (limited to 'packages/gitbook-core/src/reducers/page.js')
-rw-r--r-- | packages/gitbook-core/src/reducers/page.js | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/packages/gitbook-core/src/reducers/page.js b/packages/gitbook-core/src/reducers/page.js index 2d8c943..9b94d1e 100644 --- a/packages/gitbook-core/src/reducers/page.js +++ b/packages/gitbook-core/src/reducers/page.js @@ -1,26 +1,8 @@ -const { Record } = require('immutable'); const ACTION_TYPES = require('../actions/TYPES'); - -const DEFAULTS = { - title: '', - content: '', - dir: 'ltr', - depth: 1, - level: '', - previous: null -}; - -class PageState extends Record(DEFAULTS) { - static create(state) { - return state instanceof PageState ? - state : new PageState({ - ...state - }); - } -} +const Page = require('../models/Page'); module.exports = (state, action) => { - state = PageState.create(state); + state = Page.create(state); switch (action.type) { |