Created
November 17, 2021 19:14
-
-
Save DistractionBoy/6ec2ee421ed5c30724765e533dd98b8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
export type ActionMap<M extends { [index: string]: any }> = { | |
[Key in keyof M]: M[Key] extends undefined | |
? { | |
type: Key | |
} | |
: { | |
type: Key | |
payload: M[Key] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment