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

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

    switch (action.type) {

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

    default:
        return state;

    }
};