Skip to content

Instantly share code, notes, and snippets.

@blogui91
Last active June 16, 2017 03:11
Show Gist options
  • Save blogui91/e3047fa7fa107c2b206179cf87c8736e to your computer and use it in GitHub Desktop.
Save blogui91/e3047fa7fa107c2b206179cf87c8736e to your computer and use it in GitHub Desktop.
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