mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-02 14:02:46 +02:00
23 lines
405 B
JavaScript
23 lines
405 B
JavaScript
export const defaultState = [];
|
|
|
|
export default function groups(state = defaultState, 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 [];
|
|
}
|
|
|
|
default: {
|
|
return state;
|
|
}
|
|
}
|
|
}
|