Una simple convención que representa respuestas de servidor JSON.
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
/** 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