Created
April 5, 2021 10:10
-
-
Save joseluisq/03a084b2cffe14e46e7cf2f00bc3ef65 to your computer and use it in GitHub Desktop.
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