@empathyco/x-components
Version:
Empathy X Components
28 lines (25 loc) • 871 B
JavaScript
import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
async fetch({ dispatch }, request) {
return dispatch('fetchNextQueries', request);
},
onSuccess({ commit }, nextQueries) {
if (nextQueries) {
commit('setNextQueries', nextQueries);
}
},
});
/**
* Default implementation for {@link NextQueriesActions.fetchAndSaveNextQueries} action.
*
* @public
*/
const fetchAndSaveNextQueries = fetchAndSave;
/**
* Default implementation for {@link NextQueriesActions.cancelFetchAndSaveNextQueries} action.
*
* @public
*/
const cancelFetchAndSaveNextQueries = cancelPrevious;
export { cancelFetchAndSaveNextQueries, fetchAndSaveNextQueries };
//# sourceMappingURL=fetch-and-save-next-queries.action.js.map