Replies: 1 comment 4 replies
-
Generally:
I would encourage you to read the Redux Style Guide on these topics. But for the type you want here: import {PayloadAction} from '@reduxjs/toolkit'
interface SomeObject {
foo: string,
bar: number,
baz: boolean
}
type KeyValuePairs<T> = ({[K in keyof T]: {key: K, value: T[K] }})[keyof T]
type MyAction = PayloadAction<KeyValuePairs<SomeObject>> |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a following scenario:
I have a slice which is for a form. Form's fields will have different value types.
E.g.
I would like to have a single action/reducer to update all of those fields. e.g.
Can anyone direct me towards how should I type the payload?
Beta Was this translation helpful? Give feedback.
All reactions