@empathyco/x-components
Version:
Empathy X Components
96 lines (43 loc) • 1.76 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [StateSelector](./x-components.stateselector.md)
## StateSelector interface
Composition type of [SimpleStateSelector](./x-components.simplestateselector.md) which allows to indicate if the state selector should be executed in first instance (first assignment of values). Selector is the [SimpleStateSelector](./x-components.simplestateselector.md) and immediate flags if the selector should be executed when it is initialized for first time.
**Signature:**
```typescript
export interface StateSelector<ReturnType, State extends Dictionary, Getters extends Dictionary> extends WatchOptions
```
**Extends:** WatchOptions
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[filter?](./x-components.stateselector.filter.md)
</td><td>
</td><td>
(newValue: ReturnType, oldValue: ReturnType, state: State) => boolean
</td><td>
_(Optional)_ Asserts if the event should really be emitted taking into account the new and old values and the module state.
</td></tr>
<tr><td>
[metadata?](./x-components.stateselector.metadata.md)
</td><td>
</td><td>
Partial<[WireMetadata](./x-components.wiremetadata.md)<!-- -->>
</td><td>
_(Optional)_
</td></tr>
<tr><td>
[selector](./x-components.stateselector.selector.md)
</td><td>
</td><td>
[SimpleStateSelector](./x-components.simplestateselector.md)<!-- --><ReturnType, State, Getters>
</td><td>
</td></tr>
</tbody></table>