Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Don't do this
enum Response {
Successful,
Failed,
Pending
}
function fetchData (status: Response): void => {
// some code.
}
// Do this
type Response = Sucessful | Failed | Pending
function fetchData (status: Response): void => {
// some code.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment