Skip to content

Instantly share code, notes, and snippets.

@abraithwaite
Created April 13, 2022 17:04
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 abraithwaite/a3c2d88d0ec6b983960d14738184bc37 to your computer and use it in GitHub Desktop.
Save abraithwaite/a3c2d88d0ec6b983960d14738184bc37 to your computer and use it in GitHub Desktop.
export interface Result<T> {
success: true
data: T
}
export interface InternalError {
success: false
user: false
error: string
}
export interface UserError {
success: false
user: true
error: string
}
export type Error = InternalError | UserError
export type ResultOrError<T> = Result<T> | Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment