WARNING: Use deanius:meteor-promise
package at https://github.com/deanius/meteor-promise
The demo-enabled README is at http://okgrow-promise.meteor.com/
The okgrow:promise package gives you the following functionality:
Meteor.promise
- The same asMeteor.call
, but you omit the callback parameter, and it returns aPromise
for the resultMeteor.wrapPromise
- Takes any callback-style function, and returns a Promise-returning function. This is likeMeteor.wrapAsync
, but useful on the client.HTTP.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
property which resolves whenready()
returnstrue
.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 okgrow:promise
, and let's discuss. Or find me on social media. Thanks for your interest!