Skip to content

Instantly share code, notes, and snippets.

@rosschapman
Last active April 24, 2020 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosschapman/06ec9df11283539a34cdf7526a78a202 to your computer and use it in GitHub Desktop.
Save rosschapman/06ec9df11283539a34cdf7526a78a202 to your computer and use it in GitHub Desktop.
Typed user actions object
type UserAction = "SUBMIT_FORM";
type UserActions = {
[key: string]: UserAction;
};
class AppConductor extends React.Component<Props, State> {
readonly userActions: UserActions = {
submitForm: "SUBMIT_FORM"
};
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment