Skip to content

Instantly share code, notes, and snippets.

@epexa
Last active April 25, 2018 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epexa/bcded8051b7c6a99b5fd6ec636964a38 to your computer and use it in GitHub Desktop.
Save epexa/bcded8051b7c6a99b5fd6ec636964a38 to your computer and use it in GitHub Desktop.
Example promise on blockchain Golos
let accounts = ['goloscore'];
golos.api.getAccounts(accounts)
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
});
// OR
const getAccounts = function(accounts) {
return golos.api.getAccounts(accounts)
.then(response => {
return response;
})
.catch(error => {
console.error(error);
});
}
getAccounts(['goloscore'])
.then(response => {
console.log(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment