@empathyco/x-components
Version:
Empathy X Components
21 lines (19 loc) • 701 B
JavaScript
/**
* Adds an {@link Facet} to the store in case it doesn't exist for the passed facetId.
*
* @param store - The {@link https://vuex.vuejs.org/guide/ | Vuex Store}.
* @param facetId - The Facet id for the Facet that will be created.
* @param facetModelName - The {@link FacetModelName} for the Facet that will be created.
* @internal
*/
function addFacetIfNotPresent(store, facetId, facetModelName) {
if (!store.state.x.facets.facets[facetId]) {
store.commit('x/facets/setFacet', {
modelName: facetModelName,
id: facetId,
label: facetId,
});
}
}
export { addFacetIfNotPresent };
//# sourceMappingURL=add-facet-if-not-present.js.map