@empathyco/x-components
Version:
Empathy X Components
27 lines (24 loc) • 930 B
JavaScript
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
async fetch({ dispatch }, request) {
return dispatch('fetchExperienceControlsResponse', request);
},
onSuccess({ commit }, experienceControlsResponse) {
commit('setControls', experienceControlsResponse.controls);
commit('setEvents', experienceControlsResponse.events);
},
});
/**
* Default implementation for fetchAndSaveExperienceControls action.
*
* @public
*/
const fetchAndSaveExperienceControlsResponse = fetchAndSave;
/**
* Default implementation for fetchAndSaveExperienceControls action.
*
* @public
*/
const cancelFetchAndSaveControls = cancelPrevious;
export { cancelFetchAndSaveControls, fetchAndSaveExperienceControlsResponse };
//# sourceMappingURL=fetch-and-save-experience-controls.action.js.map