summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/reducers/page.js
blob: 9b94d1efb2666a7a7f55b2ddabd6d727e3e0a854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const ACTION_TYPES = require('../actions/TYPES');
const Page = require('../models/Page');

module.exports = (state, action) => {
    state = Page.create(state);

    switch (action.type) {

    case ACTION_TYPES.PAGE_FETCH_END:
        return state.merge(action.payload.page);

    default:
        return state;

    }
};