deanius:promise
Install
meteor add deanius:promise
API
The deanius:promise package gives you the following functionality:
Meteor.callPromise
- The same as Meteor.call, but you omit the callback parameter, and it returns aPromise
for the resultMeteor.runAsync
- Uses the co NPM Library to run a JavaScript generator function yielding promises, as though it were synchronousHTTP.getPromise
- All methods on the HTTP object will have Promise-returning versions, just appendPromise
onto the method name.Meteor.subscribe
- The object returned byMeteor.subscribe
will have areadyPromise()
function which, when called, returns a Promise that resolves whenready()
returnstrue
.Meteor.wrapPromise
- Takes any callback-style function, and returns a Promise-returning function. This is like Meteor.wrapAsync, but useful on the client.ReactivePromise
- A function to wrap Promise-returning functions with, to create reactive functions - such as helpers - which update when their promised value becomes available.
Thoughts? Questions? Open an issue in deanius:promise
, and let's discuss. Or find me on social media. Thanks for your interest!