Published: 31 Mar 2018 › Updated: 31 Mar 2018

Steem.js api comes with functions that return Promises
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...
Leave Steem.js api comes with functions that return Promises to:
Read more #steemit posts
Best Posts From nafestw
We have not curated any of nafestw's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From nafestw
- Welcome to STEEM @qiortate12, @qiortate13, @qiortate14, @qiortate15, @qiortate16, @qiortate17, @qiortate18, @qiortate19, and @qiortate20 [which are totally not abusing @steem's delegations for new users]
- Celebrating my first 100 STEEM days with free upvotes
- More than 500.000 SP undelegated from @dmania in the last 24 hours
- DeepSteem - Increased robustness and some minor features
- Missing error handling in WebSockets code
- DeepSteem - A dashboard for the STEEM blockchain
- DeepSteem now shows the cumulative voting value of all your followers
- My current side project: DeepSteem - a dashboard for STEEM
- A good time to use bid bots (SBD demand already rising)
- Steem.js api comes with functions that return Promises