UNPKG

@empathyco/x-components

Version:
28 lines (25 loc) 887 B
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js'; const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({ async fetch({ dispatch }, request) { return dispatch('fetchRecommendations', request); }, onSuccess({ commit }, recommendations) { commit('setRecommendations', recommendations); }, }); /** * Default implementation for {@link RecommendationsActions.fetchAndSaveRecommendations} * action. * * @public */ const fetchAndSaveRecommendations = fetchAndSave; /** * Default implementation for {@link RecommendationsActions.cancelFetchAndSaveRecommendations} * action. * * @public */ const cancelFetchAndSaveRecommendations = cancelPrevious; export { cancelFetchAndSaveRecommendations, fetchAndSaveRecommendations }; //# sourceMappingURL=fetch-and-save-recommendations.action.js.map