UNPKG

choices.js

Version:

A vanilla JS customisable text input/select box plugin

23 lines (19 loc) 390 B
const groups = (state = [], action) => { switch (action.type) { case 'ADD_GROUP': { return [...state, { id: action.id, value: action.value, active: action.active, disabled: action.disabled, }]; } case 'CLEAR_CHOICES': { return state.groups = []; } default: { return state; } } }; export default groups;