Choices/src/scripts/actions/groups.js

18 lines
328 B
JavaScript
Raw Normal View History

import { ACTION_TYPES } from '../constants';
2017-10-10 16:30:06 +02:00
/**
* @typedef {import('../../../types/index').Choices.Group} Group
*/
/**
* @param {Group} group
* @returns {{ type: string } & Group}
*/
export const addGroup = ({ value, id, active, disabled }) => ({
2017-10-10 16:30:06 +02:00
type: ACTION_TYPES.ADD_GROUP,
2017-10-10 16:26:38 +02:00
value,
id,
active,
disabled,
});