Skip to content

Instantly share code, notes, and snippets.

@duanebester
Last active November 14, 2019 01:08
Show Gist options
  • Save duanebester/7f28e948fe59655bdf87f7b416439dd7 to your computer and use it in GitHub Desktop.
Save duanebester/7f28e948fe59655bdf87f7b416439dd7 to your computer and use it in GitHub Desktop.
Reducer Interface Example
export interface Bucket {
notes: string;
id?: string;
}
export interface UpdateNotesPayload {
targetIndex: number;
value: string;
}
export interface UpdateNotesAction {
type: 'updateNotes';
payload: UpdateNotesPayload;
}
export interface AddAction {
type: 'addBucket';
}
export type Action =
| AddAction
| UpdateNotesAction;
export interface State {
buckets: Bucket[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment