UNPKG

@empathyco/x-components

Version:
26 lines (24 loc) 831 B
/** * Default implementation for the {@link SemanticQueriesGetters.request} getter. * * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the semantic * queries module. * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the * semantic queries' module. * @returns The semantic queries request to fetch data from the API. * * @public */ const request = ({ params, totalResults, config: { threshold, maxItemsToRequest } }, { normalizedQuery }) => { return normalizedQuery && totalResults <= threshold ? { query: normalizedQuery, extraParams: { ...params, k: maxItemsToRequest, }, } : null; }; export { request }; //# sourceMappingURL=request.getter.js.map