UNPKG

@empathyco/x-components

Version:
51 lines (48 loc) 1.48 kB
import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js'; import { setStatus } from '../../../store/utils/status-store.utils.js'; import { cancelFetchAndSaveSuggestions, fetchAndSaveSuggestions } from './actions/fetch-and-save-suggestions.action.js'; import { fetchSuggestions } from './actions/fetch-suggestions.action.js'; import { popularSearches } from './getters/popular-searches.getter.js'; import { request } from './getters/request.getter.js'; /** * {@link XStoreModule} For the next-queries module. * * @internal */ const popularSearchesXStoreModule = { state: () => ({ popularSearches: [], searchedQueries: [], status: 'initial', config: { hideSessionQueries: true, maxItemsToRequest: 20, }, params: {}, }), getters: { request, popularSearches, }, mutations: { setSuggestions(state, suggestions) { state.popularSearches = suggestions; }, setSearchedQueries(state, searchedQueries) { state.searchedQueries = searchedQueries; }, setParams(state, params) { state.params = params; }, setStatus, setConfig, mergeConfig, }, actions: { cancelFetchAndSaveSuggestions, fetchSuggestions, fetchAndSaveSuggestions, }, }; export { popularSearchesXStoreModule }; //# sourceMappingURL=module.js.map