mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-28 10:20:08 +02:00
35 lines
524 B
JavaScript
35 lines
524 B
JavaScript
import { ACTION_TYPES } from './../constants';
|
|
|
|
export const addItem = ({
|
|
value,
|
|
label,
|
|
id,
|
|
choiceId,
|
|
groupId,
|
|
customProperties,
|
|
placeholder,
|
|
keyCode,
|
|
}) => ({
|
|
type: ACTION_TYPES.ADD_ITEM,
|
|
value,
|
|
label,
|
|
id,
|
|
choiceId,
|
|
groupId,
|
|
customProperties,
|
|
placeholder,
|
|
keyCode,
|
|
});
|
|
|
|
export const removeItem = (id, choiceId) => ({
|
|
type: ACTION_TYPES.REMOVE_ITEM,
|
|
id,
|
|
choiceId,
|
|
});
|
|
|
|
export const highlightItem = (id, highlighted) => ({
|
|
type: ACTION_TYPES.HIGHLIGHT_ITEM,
|
|
id,
|
|
highlighted,
|
|
});
|