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

67 lines
1 KiB
JavaScript
Raw Normal View History

2016-07-13 22:40:59 +02:00
export const addItem = (value, label, id, choiceId, activateOptions) => {
return {
type: 'ADD_ITEM',
value,
label,
id,
choiceId,
activateOptions,
};
};
2016-03-30 16:04:21 +02:00
export const removeItem = (id, choiceId) => {
return {
type: 'REMOVE_ITEM',
id,
choiceId,
};
};
2016-03-30 16:04:21 +02:00
export const highlightItem = (id, highlighted) => {
return {
type: 'HIGHLIGHT_ITEM',
id,
highlighted,
};
2016-04-12 15:31:07 +02:00
};
export const addChoice = (value, label, id, groupId, disabled) => {
return {
type: 'ADD_CHOICE',
value,
label,
id,
groupId,
disabled,
};
};
export const filterChoices = (results) => {
return {
type: 'FILTER_CHOICES',
results,
};
};
export const activateChoices = (active = true) => {
return {
type: 'ACTIVATE_CHOICES',
active,
};
};
export const addGroup = (value, id, active, disabled) => {
return {
type: 'ADD_GROUP',
value,
id,
active,
disabled,
};
};
export const clearAll = () => {
return {
type: 'CLEAR_ALL',
};
};