mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-04 06:43:15 +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
29 lines
452 B
JavaScript
29 lines
452 B
JavaScript
/**
|
|
* @typedef {import('redux').Action} Action
|
|
*/
|
|
|
|
/**
|
|
* @returns {Action}
|
|
*/
|
|
export const clearAll = () => ({
|
|
type: 'CLEAR_ALL',
|
|
});
|
|
|
|
/**
|
|
* @param {any} state
|
|
* @returns {Action & { state: object }}
|
|
*/
|
|
export const resetTo = state => ({
|
|
type: 'RESET_TO',
|
|
state,
|
|
});
|
|
|
|
/**
|
|
* @param {boolean} isLoading
|
|
* @returns {Action & { isLoading: boolean }}
|
|
*/
|
|
export const setIsLoading = isLoading => ({
|
|
type: 'SET_IS_LOADING',
|
|
isLoading,
|
|
});
|