Meteor.wrapAsync and bindEnviroment

Where can the community find better documentation on Meteor.wrapAsync and bindEnviroment? I don’t mean buying a educational program. They seem to be core to Meteor, yet, least documented.

1 Like

You normally don’t wanna use bindEnvironment. Using Meteor.wrapAsync is enough. Check following articles and videos:

Agreed. There are also official docs for wrapAsync though they may not be perfect: http://docs.meteor.com/#/full/meteor_wrapasync

@arunoda Thanks for the links. They were helpful.

@emmanuelbuah – You bring up some very good points – A huge part of Meteor’s appeal to programmers is to enable coding in a synchronous style while sleeping the CPU, not blocking it. And wrapAsync seems like such an important bridge to enable programmers to use over 140,000 existing Node NPM packages. Nevertheless, I also struggled to understand the official docs and to find a simple working demo. If it’s too hard to understand how to confidently wrap async calls, one might as well stick to writing callbacks, and then one of the major benefits of Meteor vanishes.

I’m not sure that I’ve figured out wrapAsync completely, but you may want to check out my StackOverflow posting which includes some demo code and a MeteorPad link so that you can play with it.

And to anyone who understands wrapAsync, I’d greatly appreciate your review, or forks to my MeteorPad demo. Thanks!

@interfusion Thanks. The links provided by @arunoda helped. Thanks for adding more resources. Im sure others will find it helpful.