UNPKG

@empathyco/x-components

Version:
26 lines (23 loc) 837 B
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js'; const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({ async fetch({ dispatch }, request) { return dispatch('fetchSuggestions', request); }, onSuccess({ commit }, suggestions) { commit('setSuggestions', suggestions); }, }); /** * Default implementation for {@link PopularSearchesActions.fetchAndSaveSuggestions} action. * * @public */ const fetchAndSaveSuggestions = fetchAndSave; /** * Default implementation for {@link PopularSearchesActions.cancelFetchAndSaveSuggestions} action. * * @public */ const cancelFetchAndSaveSuggestions = cancelPrevious; export { cancelFetchAndSaveSuggestions, fetchAndSaveSuggestions }; //# sourceMappingURL=fetch-and-save-suggestions.action.js.map