Skip to content

Instantly share code, notes, and snippets.

@ckoster22
Last active August 26, 2017 00:11
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 ckoster22/92cd2de60ddc966eca528e5001e7a893 to your computer and use it in GitHub Desktop.
Save ckoster22/92cd2de60ddc966eca528e5001e7a893 to your computer and use it in GitHub Desktop.
type AsyncData<Data> = Initial | Retrieving | Success<Data> | Error;
type Initial = {
kind: 'Initial'
};
type Retrieving = {
kind: 'Retrieving'
};
type Success<Data> = {
kind: 'Success',
data: Data[]
};
type Error = {
kind: 'Error',
message: string
};
// ----
type User = {
login: string,
avatarUrl: string
};
type PageState = AsyncData<User>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment