UNPKG

@empathyco/x-components

Version:
27 lines (24 loc) 888 B
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