2019-10-21 21:03:57 +02:00
|
|
|
import { ACTION_TYPES } from '../constants';
|
2017-10-10 16:30:06 +02:00
|
|
|
|
2018-05-29 20:55:33 +02:00
|
|
|
export const addItem = ({
|
2017-10-10 16:26:38 +02:00
|
|
|
value,
|
|
|
|
label,
|
|
|
|
id,
|
|
|
|
choiceId,
|
|
|
|
groupId,
|
|
|
|
customProperties,
|
|
|
|
placeholder,
|
|
|
|
keyCode,
|
2018-05-29 20:55:33 +02:00
|
|
|
}) => ({
|
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,
|
|
|
|
});
|