@empathyco/x-components
Version:
Empathy X Components
65 lines (35 loc) • 1.21 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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<Facet\['id'\]>; alwaysVisible?: boolean; }
</td><td>
Composable props.
</td></tr>
</tbody></table>
**Returns:**
{ selectedFiltersByFacet: ComputedRef<[FiltersByFacet](./x-components.filtersbyfacet.md)<!-- -->>; selectedFilters: ComputedRef<Filter\[\]>; hasSelectedFilters: ComputedRef<boolean>; isVisible: ComputedRef<boolean>; }
Composable.