@empathyco/x-components
Version:
Empathy X Components
27 lines (24 loc) • 888 B
JavaScript
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
// eslint-disable-next-line max-len
const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
fetch({ dispatch }, request) {
return dispatch('fetchSuggestions', request);
},
onSuccess({ commit }, suggestions) {
commit('setSuggestions', suggestions);
}
});
/**
* Default implementation for {@link QuerySuggestionsActions.fetchAndSaveSuggestions} action.
*
* @public
*/
const fetchAndSaveSuggestions = fetchAndSave;
/**
* Default implementation for {@link QuerySuggestionsActions.cancelFetchAndSaveSuggestions} action.
*
* @public
*/
const cancelFetchAndSaveSuggestions = cancelPrevious;
export { cancelFetchAndSaveSuggestions, fetchAndSaveSuggestions };
//# sourceMappingURL=fetch-and-save-suggestions.action.js.map