@empathyco/x-components
Version:
Empathy X Components
24 lines (22 loc) • 727 B
JavaScript
/**
* Default implementation for the {@link FacetsGetters.request} getter.
*
* @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets
* module.
* @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the
* facets module.
* @returns The facets request to fetch data from the API.
* @public
*/
const request = ({ query, origin, params }, { selectedFiltersByFacet }) => {
return query
? {
query,
origin: origin === null ? undefined : origin,
filters: selectedFiltersByFacet,
extraParams: params,
}
: null;
};
export { request };
//# sourceMappingURL=request.getter.js.map