import { TopRecommendationsRequest } from '@empathyco/x-adapter' ; import { Result } from '@empathyco/x-types' ; import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils' ; import { RecommendationsActionContext } from '../types' ; const { fetchAndSave , cancelPrevious } = createFetchAndSaveActions < RecommendationsActionContext , TopRecommendationsRequest | null , Result [ ] > ( { fetch ( { dispatch } , request ) { return dispatch ( 'fetchRecommendations' , request ) ; } , onSuccess ( { commit } , recommendations ) { commit ( 'setRecommendations' , recommendations ) ; } } ) ; /**
 * Default implementation for  RecommendationsActions . fetchAndSaveRecommendations * action.
 *
 *  public export const fetchAndSaveRecommendations = fetchAndSave ; /**
 * Default implementation for  RecommendationsActions . cancelFetchAndSaveRecommendations * action.
 *
 *  public export const cancelFetchAndSaveRecommendations = cancelPrevious ;