@empathyco/x-components
Version:
Empathy X Components
59 lines (29 loc) • 942 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [useState](./x-components.usestate.md)
## useState() function
Function which returns the requested state's properties as a dictionary.
**Signature:**
```typescript
export declare function useState<Module extends XModuleName, State = ExtractState<Module>>(module: Module): {
[P in keyof State]: ComputedRef<State[P]>;
};
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
module
</td><td>
Module
</td><td>
The [XModuleName](./x-components.xmodulename.md) of the getter.
</td></tr>
</tbody></table>
**Returns:**
{ \[P in keyof State\]: ComputedRef<State\[P\]>; }
A dictionary of computed state properties of the module.