@empathyco/x-components
Version:
Empathy X Components
29 lines (26 loc) • 938 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('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