Skip to content

Instantly share code, notes, and snippets.

@carlrip
Created February 3, 2019 10:32
Show Gist options
  • Save carlrip/512a18156d743a1fe417be7aad3fdcfd to your computer and use it in GitHub Desktop.
Save carlrip/512a18156d743a1fe417be7aad3fdcfd to your computer and use it in GitHub Desktop.
React Redux Actions with TypeScript
export interface IGettingPeopleAction extends Action<'GettingPeople'> {}
export interface IGotPeopleAction extends Action<'GotPeople'> {
people: IPerson[];
}
export interface IPostingPersonAction extends Action<'PostingPerson'> {
type: 'PostingPerson';
}
export interface IPostedPersonAction extends Action<'PostedPerson'> {
result: IPostPersonResult;
}
export type PeopleActions =
| IGettingPeopleAction
| IGotPeopleAction
| IPostingPersonAction
| IPostedPersonAction;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment