summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/reducers/components.js
blob: 948a3ac3bbf7905b57731f87b623e9aeb8513d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const { List } = require('immutable');
const ACTION_TYPES = require('../actions/TYPES');

function reduceComponents(state, action) {
    state = state || List();
    switch (action.type) {

    case ACTION_TYPES.REGISTER_COMPONENT:
        return state.push({
            Component: action.Component,
            descriptor: action.descriptor
        });

    default:
        return state;

    }
}

module.exports = reduceComponents;