Steem.js api comes with functions that return Promises

in #steemit7 years ago

I just found out, that steem.js comes with api calls that already return Promises. You only have to append Async to the function name and voilà:

"use strict";

const steem = require("steem");

steem.api.getAccountsAsync(["nafestw"]).then(r => {
  console.log(r[0]);
});

All the manual wrapping in promises was totally pointless...

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.039
BTC 95654.77
ETH 3579.91
USDT 1.00
SBD 3.84