I’m trying to implement a Vimeo API and after some thought, the only way I could do this while returning appropriate responses to client was if I did it synchronously (in conjunction with a try/catch block).
Anyway, this is the Vimeo function I converted to sync via Meteor.wrapAsync
:
lib.streamingUpload("/path/to/file", (err, body, status_code, headers) => {});
Of course, this is how it turns out with the wrapAsync:
const upload = Meteor.wrapAsync(lib.streamingUpload, lib);
Now, when I console log the upload
above, the only parameter it returns is the body
. For purposes of storing the upload URL, I need to have access to the headers
parameter. How could I do this with Meteor.wrapAsync()
?