Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Created April 5, 2021 10:10
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 joseluisq/03a084b2cffe14e46e7cf2f00bc3ef65 to your computer and use it in GitHub Desktop.
Save joseluisq/03a084b2cffe14e46e7cf2f00bc3ef65 to your computer and use it in GitHub Desktop.
Una simple convención que representa respuestas de servidor JSON.
/** Representa una respuesta JSON satisfactoria */
interface ResponseOk<T = null> {
success: true
data: T
}
/** Representa una respuesta JSON errónea */
interface ResponseFail<T = null> {
success: false
code: string|number
data: T
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment