@empathyco/x-components
Version:
Empathy X Components
18 lines (11 loc) • 1.56 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [StoreEmitters](./x-components.storeemitters.md)
## StoreEmitters type
Dictionary where the key is a [XEvent](./x-components.xevent.md)<!-- -->, and the value is [SimpleStateSelector](./x-components.simplestateselector.md) or [StateSelector](./x-components.stateselector.md)<!-- -->. This [SimpleStateSelector](./x-components.simplestateselector.md) or [StateSelector](./x-components.stateselector.md) can only access the state and getters from the [XStoreModule](./x-components.xstoremodule.md) passed as param type. This dictionary is used to emits a [XEvent](./x-components.xevent.md) when the part of the store selected by [SimpleStateSelector](./x-components.simplestateselector.md) changes.
**Signature:**
```typescript
export type StoreEmitters<StoreModule extends AnyXStoreModule> = {
[Event in XEvent]?: SimpleStateSelector<XEventPayload<Event>, ReturnType<StoreModule['state']>, Returns<StoreModule['getters']>> | StateSelector<XEventPayload<Event>, ReturnType<StoreModule['state']>, Returns<StoreModule['getters']>>;
};
```
**References:** [AnyXStoreModule](./x-components.anyxstoremodule.md)<!-- -->, [XEvent](./x-components.xevent.md)<!-- -->, [SimpleStateSelector](./x-components.simplestateselector.md)<!-- -->, [XEventPayload](./x-components.xeventpayload.md)<!-- -->, [Returns](./x-components.returns.md)<!-- -->, [StateSelector](./x-components.stateselector.md)