Choices/src/scripts/actions/choices.js
2018-05-29 19:55:33 +01:00

39 lines
615 B
JavaScript

import { ACTION_TYPES } from './../constants';
export const addChoice = ({
value,
label,
id,
groupId,
disabled,
elementId,
customProperties,
placeholder,
keyCode,
}) => ({
type: ACTION_TYPES.ADD_CHOICE,
value,
label,
id,
groupId,
disabled,
elementId,
customProperties,
placeholder,
keyCode,
});
export const filterChoices = results => ({
type: ACTION_TYPES.FILTER_CHOICES,
results,
});
export const activateChoices = (active = true) => ({
type: ACTION_TYPES.ACTIVATE_CHOICES,
active,
});
export const clearChoices = () => ({
type: ACTION_TYPES.CLEAR_CHOICES,
});