UNPKG

@empathyco/x-components

Version:
27 lines (24 loc) 930 B
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