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;