Last active
November 12, 2020 07:03
-
-
Save guillaumewuip/5c125be210a7f853b464544f1d7c51cf to your computer and use it in GitHub Desktop.
State and Store in frontend codebase - State example - state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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