UNPKG

@empathyco/x-components

Version:
60 lines (57 loc) 1.56 kB
import { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js'; import { createWiring } from '../../wiring/wiring.utils.js'; /** * `recommendations` {@link XModuleName | XModule name}. * * @internal */ const moduleName = 'recommendations'; /** * WireDispatch for {@link RecommendationsXModule}. * * @internal */ const wireDispatch = namespacedWireDispatch(moduleName); /** * WireCommit for {@link RecommendationsXModule}. * * @internal */ const wireCommit = namespacedWireCommit(moduleName); /** * Requests and stores the recommendations. * * @public */ const fetchAndSaveRecommendations = wireDispatch('fetchAndSaveRecommendations'); /** * Requests and stores the enrichment results for the recommendations. * * @public */ const fetchAndSaveRecommendationsEnrichmentWire = wireDispatch('fetchAndSaveRecommendationsEnrichment'); /** * Sets the recommendations state `params`. * * @public */ const setRecommendationsExtraParams = wireCommit('setParams'); /** * Wiring configuration for the {@link RecommendationsXModule | recommendations module}. * * @internal */ const recommendationsWiring = createWiring({ RecommendationsChanged: { fetchAndSaveRecommendationsEnrichmentWire, }, RecommendationsRequestUpdated: { fetchAndSaveRecommendations, }, UserClickedColumnPicker: {}, ExtraParamsChanged: { setRecommendationsExtraParams, }, }); export { recommendationsWiring, setRecommendationsExtraParams }; //# sourceMappingURL=wiring.js.map