@empathyco/x-components
Version:
Empathy X Components
56 lines (53 loc) • 1.6 kB
JavaScript
import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
import { setQuery } from '../../../store/utils/query.utils.js';
import { fetchAndSaveSemanticQuery } from './actions/fetch-and-save-semantic-query.action.js';
import { fetchSemanticQuery } from './actions/fetch-semantic-query.action.js';
import { normalizedQuery } from './getters/normalized-query.getter.js';
import { request } from './getters/request.getter.js';
import { query } from './getters/semanti-queries-query.getter.js';
/**
* {@link XStoreModule} For the `semantic-queries` module.
*
* @internal
*/
const semanticQueriesXStoreModule = {
state: () => ({
config: {
threshold: 5,
maxItemsToRequest: 3,
},
semanticQueries: [],
params: {},
query: '',
totalResults: 0,
relatedTags: [],
}),
getters: {
request,
normalizedQuery,
query,
},
mutations: {
setParams(state, params) {
state.params = params;
},
setSemanticQueries(state, queries) {
state.semanticQueries = queries;
},
setQuery,
setTotalResults(state, totalResults) {
state.totalResults = totalResults;
},
setSemanticQueriesRelatedTags(state, relatedTags) {
state.relatedTags = relatedTags;
},
setConfig,
mergeConfig,
},
actions: {
fetchSemanticQuery,
fetchAndSaveSemanticQuery,
},
};
export { semanticQueriesXStoreModule };
//# sourceMappingURL=module.js.map