Skip to content

Instantly share code, notes, and snippets.

@guillaumewuip
Last active November 12, 2020 07:03
Show Gist options
  • Save guillaumewuip/5c125be210a7f853b464544f1d7c51cf to your computer and use it in GitHub Desktop.
Save guillaumewuip/5c125be210a7f853b464544f1d7c51cf to your computer and use it in GitHub Desktop.
State and Store in frontend codebase - State example - state
import * as NonEmptyArray from "fp-ts/lib/NonEmptyArray";
import * as User from "./user";
export type State = Loading | Failure | Loaded;
export const initialState: Loading = "Loading";
type Loading = "Loading";
type Failure = Error;
type Loaded = { users: NonEmptyArray.NonEmptyArray<User.User> };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment