Created
July 18, 2022 23:16
-
-
Save rayrayzayzay/23874bfb9a5465249f77f34dfd88eafa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
✅ Explicit modeling of distinct states | |
type UserProfileFetching = { | |
status: "fetching" | |
} | |
type UserProfileSuccess = { | |
status: "success" | |
data: UserProfileData | |
statusCode: number | |
} | |
type UserProfileError = { | |
status: "error" | |
errorMessage: string | |
statusCode: number | |
} | |
type UserProfileRequest = UserProfileFetching | | |
UserProfileSuccess | UserProfileError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment