Now it returns the value directly (or throws an error). Perfect for server-side methods!
const result = await new Promise((resolve) => setTimeout(() => resolve('Done'), 1000) ); meteor wrapasync
// Without wrapAsync (callback style) function fetchData(callback) { setTimeout(() => callback(null, { user: 'alice' }), 100); } Now it returns the value directly (or throws an error)
wrapAsync is a function in Meteor that allows you to wrap a Node-style asynchronous function (i.e., a function that takes a callback as its last argument) into a synchronous function. { user: 'alice' })