Skip to content

Instantly share code, notes, and snippets.

@izumskee
Created August 1, 2015 10:27
Show Gist options
  • Save izumskee/6c56d3e0747fcc37173b to your computer and use it in GitHub Desktop.
Save izumskee/6c56d3e0747fcc37173b to your computer and use it in GitHub Desktop.
Use Async Functions With Meteor
var GithubAPI = Meteor.require('github');
var ghapi = new GithubAPI({version: "3.0.0"});
function getUserProfile(req, callback) {
ghapi.user.getFrom(req, callback);
}
var wrappedGetProfile = Meteor._wrapAsync(getUserProfile);
Meteor.methods({
getProfile: function(username) {
return wrappedGetProfile({user: username});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment