@empathyco/x-components
Version:
Empathy X Components
25 lines (15 loc) • 743 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [MutationsDictionary](./x-components.mutationsdictionary.md)
## MutationsDictionary type
Util type for being used on generic constraints which will only accept an object containing mutations.
**Signature:**
```typescript
export type MutationsDictionary<Mutations> = Record<keyof Mutations, (payload?: any) => void>;
```
## Example
Example constraint
```typescript
// This function allows receiving any object who only contains mutations;
function sampleFunction\<Mutations extends MutationsDictionary\<Mutations\>\>
(mutations: Mutations): void;
```