mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 08:52:19 +02:00
23 lines
390 B
JavaScript
23 lines
390 B
JavaScript
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;
|