mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-09 17:16:36 +02:00
51 lines
838 B
JavaScript
51 lines
838 B
JavaScript
export const addItem = (value, label, id, optionId) => {
|
|
return {
|
|
type: 'ADD_ITEM',
|
|
value,
|
|
label,
|
|
id,
|
|
optionId,
|
|
}
|
|
};
|
|
|
|
export const removeItem = (id, optionId) => {
|
|
return {
|
|
type: 'REMOVE_ITEM',
|
|
id,
|
|
optionId,
|
|
}
|
|
};
|
|
|
|
export const selectItem = (id, selected) => {
|
|
return {
|
|
type: 'SELECT_ITEM',
|
|
id,
|
|
selected,
|
|
}
|
|
};
|
|
|
|
export const addOption = (value, label, id, groupId) => {
|
|
return {
|
|
type: 'ADD_OPTION',
|
|
value,
|
|
label,
|
|
id,
|
|
groupId,
|
|
}
|
|
};
|
|
|
|
export const selectOption = (id, selected) => {
|
|
return {
|
|
type: 'SELECT_OPTION',
|
|
id,
|
|
selected,
|
|
}
|
|
};
|
|
|
|
export const addGroup = (value, id) => {
|
|
return {
|
|
type: 'ADD_GROUP',
|
|
value,
|
|
id,
|
|
}
|
|
}; |