mirror of
https://github.com/Choices-js/Choices.git
synced 2024-04-24 10:29:30 +02:00
ab22347d7b
* Add placeholder options to demo page * Use constant types in components * Refactor adding predefined groups/items/choices * Add 'highlighted' flag to Item type * Fix dispatch param type * Build * Add jsdoc comments to utils * Remove unused file * Add default values to js doc comments * Use Redux Action type * Housekeeping * Increase utils coverage * Apply suggestions from code review * Add _getTemplate unit tests
19 lines
362 B
JavaScript
19 lines
362 B
JavaScript
import { ACTION_TYPES } from '../constants';
|
|
|
|
/**
|
|
* @typedef {import('redux').Action} Action
|
|
* @typedef {import('../../../types/index').Choices.Group} Group
|
|
*/
|
|
|
|
/**
|
|
* @param {Group} group
|
|
* @returns {Action & Group}
|
|
*/
|
|
export const addGroup = ({ value, id, active, disabled }) => ({
|
|
type: ACTION_TYPES.ADD_GROUP,
|
|
value,
|
|
id,
|
|
active,
|
|
disabled,
|
|
});
|