Created
October 2, 2014 09:31
-
-
Save jakobdamjensen/33b57104e951e493954a to your computer and use it in GitHub Desktop.
Async throw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
insertIt: function (name) { | |
var fut = new Future(); | |
Books.insert({title: name}, function(err, result){ | |
if(err){ | |
fut.throw(err); | |
} | |
}); | |
return fut.wait(); | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment