UNPKG

@empathyco/x-components

Version:
30 lines (27 loc) 927 B
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js'; const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({ async fetch({ dispatch }, request) { return dispatch('fetchRelatedPrompts', request); }, onSuccess({ commit }, relatedPrompts) { if (relatedPrompts) { commit('setRelatedPromptsProducts', relatedPrompts); } }, }); /** * Default implementation for * {@link RelatedPromptsActions.fetchAndSaveRelatedPrompts} action. * * @public */ const fetchAndSaveRelatedPrompts = fetchAndSave; /** * Default implementation for * {@link RelatedPromptsActions.cancelFetchAndSaveRelatedPrompts} action. * * @public */ const cancelFetchAndSaveRelatedPrompts = cancelPrevious; export { cancelFetchAndSaveRelatedPrompts, fetchAndSaveRelatedPrompts }; //# sourceMappingURL=fetch-and-save-related-prompts.action.js.map