Choices/src/scripts/actions/items.js

35 lines
522 B
JavaScript
Raw Normal View History

2017-10-10 16:30:06 +02:00
import { ACTION_TYPES } from './../constants';
2017-10-10 16:26:38 +02:00
export const addItem = (
value,
label,
id,
choiceId,
groupId,
customProperties,
placeholder,
keyCode,
) => ({
2017-10-10 16:30:06 +02:00
type: ACTION_TYPES.ADD_ITEM,
2017-10-10 16:26:38 +02:00
value,
label,
id,
choiceId,
groupId,
customProperties,
placeholder,
keyCode,
});
export const removeItem = (id, choiceId) => ({
2017-10-10 16:30:06 +02:00
type: ACTION_TYPES.REMOVE_ITEM,
2017-10-10 16:26:38 +02:00
id,
choiceId,
});
export const highlightItem = (id, highlighted) => ({
2017-10-10 16:30:06 +02:00
type: ACTION_TYPES.HIGHLIGHT_ITEM,
2017-10-10 16:26:38 +02:00
id,
highlighted,
});