Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Promise #21

Open
masterT opened this issue Nov 24, 2017 · 2 comments
Open

Support Promise #21

masterT opened this issue Nov 24, 2017 · 2 comments
Assignees
Milestone

Comments

@masterT
Copy link
Owner

masterT commented Nov 24, 2017

No description provided.

@notchris
Copy link

notchris commented Dec 24, 2017

var getAlbumInfo = util.promisify(bandcamp.getAlbumInfo);

async function getCollection(albums, res){
  var ps = albums.map(album => getAlbumInfo(album));
  return Promise.all(ps).then(collection => res.json(collection));
}

@masterT
Copy link
Owner Author

masterT commented Jan 15, 2018

@notchris Thanks I didn't know about the util.promisify function of the Standard Lib.
I'll use it! 😀

@masterT masterT self-assigned this Jan 15, 2018
@masterT masterT added this to the Version 1.1.0 milestone Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants