UNPKG

@empathyco/x-components

Version:
65 lines (35 loc) 1.21 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [useFacets](./x-components.usefacets.md) ## useFacets() function Composable to share Facets logic. **Signature:** ```typescript export declare function useFacets(props: { facetsIds?: Array<Facet['id']>; alwaysVisible?: boolean; }): { selectedFiltersByFacet: ComputedRef<FiltersByFacet>; selectedFilters: ComputedRef<Filter[]>; hasSelectedFilters: ComputedRef<boolean>; isVisible: ComputedRef<boolean>; }; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> props </td><td> { facetsIds?: Array&lt;Facet\['id'\]&gt;; alwaysVisible?: boolean; } </td><td> Composable props. </td></tr> </tbody></table> **Returns:** { selectedFiltersByFacet: ComputedRef&lt;[FiltersByFacet](./x-components.filtersbyfacet.md)<!-- -->&gt;; selectedFilters: ComputedRef&lt;Filter\[\]&gt;; hasSelectedFilters: ComputedRef&lt;boolean&gt;; isVisible: ComputedRef&lt;boolean&gt;; } Composable.