Choices/assets/scripts/src/actions/index.js

51 lines
838 B
JavaScript
Raw Normal View History

export const addItem = (value, label, id, optionId) => {
2016-03-30 16:04:21 +02:00
return {
type: 'ADD_ITEM',
value,
label,
id,
optionId,
2016-03-30 16:04:21 +02:00
}
};
2016-03-30 16:04:21 +02:00
2016-04-14 15:43:36 +02:00
export const removeItem = (id, optionId) => {
2016-03-30 16:04:21 +02:00
return {
type: 'REMOVE_ITEM',
id,
optionId,
2016-03-30 16:04:21 +02:00
}
};
2016-03-30 16:04:21 +02:00
export const selectItem = (id, selected) => {
2016-03-30 16:04:21 +02:00
return {
type: 'SELECT_ITEM',
id,
selected,
2016-03-30 16:04:21 +02:00
}
2016-04-12 15:31:07 +02:00
};
export const addOption = (value, label, id, groupId) => {
2016-04-12 15:31:07 +02:00
return {
type: 'ADD_OPTION',
value,
label,
id,
groupId,
}
};
export const selectOption = (id, selected) => {
return {
type: 'SELECT_OPTION',
id,
selected,
2016-04-12 15:31:07 +02:00
}
};
export const addGroup = (value, id) => {
return {
type: 'ADD_GROUP',
value,
id,
}
};