Created
November 6, 2018 14:08
-
-
Save enzzoperez/aef3f5ee7ff1112b83a230cbade81fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
getCatalogFromAPI(lastUpdate) { | |
return new Promise((resolve, reject)=>{ | |
fetch(URL_API). | |
then(res=>{ | |
if (res && res.status == 200){ | |
resolve(res.json()) | |
} | |
else | |
reject("Hubo un error al recuperar datos.") | |
}) | |
.catch(e=> Reactotron.log('Error de conexion .', e)) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment