@empathyco/x-components
Version:
Empathy X Components
59 lines (56 loc) • 1.51 kB
JavaScript
import { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js';
import { createWiring } from '../../wiring/wiring.utils.js';
/**
* `popularSearches` {@link XModuleName | XModule name}.
*
* @internal
*/
const moduleName = 'popularSearches';
/**
* WireDispatch for {@link PopularSearchesXModule}.
*
* @internal
*/
const wireDispatch = namespacedWireDispatch(moduleName);
/**
* WireCommit for {@link PopularSearchesXModule}.
*
* @internal
*/
const wireCommit = namespacedWireCommit(moduleName);
/**
* Requests and stores the popular searches.
*
* @public
*/
const retrievePopularSuggestions = wireDispatch('fetchAndSaveSuggestions');
/**
* Sets the popular searches state `searchedQueries` with the list of history queries.
*
* @public
*/
const setSearchedQueriesInPopularSearches = wireCommit('setSearchedQueries');
/**
* Sets the popular searches state `params`.
*
* @public
*/
const setPopularSearchesExtraParams = wireCommit('setParams');
/**
* Wiring configuration for the popular searches modules.
*
* @internal
*/
const popularSearchesWiring = createWiring({
PopularSearchesRequestUpdated: {
retrievePopularSuggestions,
},
SessionHistoryQueriesChanged: {
setSearchedQueriesInPopularSearches,
},
ExtraParamsChanged: {
setPopularSearchesExtraParams,
},
});
export { popularSearchesWiring, setPopularSearchesExtraParams, setSearchedQueriesInPopularSearches };
//# sourceMappingURL=wiring.js.map