Last active
June 16, 2017 03:11
-
-
Save blogui91/e3047fa7fa107c2b206179cf87c8736e to your computer and use it in GitHub Desktop.
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
import Client from 'services/Client.service' | |
let myClients | |
let client_promise = Client.get(); | |
client_promise.then(response =>{ | |
myClients = response | |
}) | |
.catch(error => { | |
console.log("error: ", error) | |
}) | |
//Even use it with Async Await!! | |
let app = { | |
async initialize(){ | |
//Async await es2017 | |
try{ | |
myClients = await Client.get() | |
} | |
catch(error){ | |
console.log("error: ", error) | |
} | |
} | |
} | |
app.initialize(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment