diff options
Diffstat (limited to 'packages/gitbook-core/src/reducers/components.js')
-rw-r--r-- | packages/gitbook-core/src/reducers/components.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/gitbook-core/src/reducers/components.js b/packages/gitbook-core/src/reducers/components.js new file mode 100644 index 0000000..948a3ac --- /dev/null +++ b/packages/gitbook-core/src/reducers/components.js @@ -0,0 +1,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; |