Hi! Any chance we could get a callback on the save function. I saw you wrote this using the fibers/future npm library.
_.extend(MeteorFile.prototype, {
save: function (dirPath, options) {
// should do dirPath checking here (see the next video or two in the series)
var filepath = path.join(dirPath, this.name);
var buffer = new Buffer(this.data);
var future = new Future;
// the future has a method named resolver that acts like a callback function that works with fibers
fs.writeFile(filepath, buffer, options, future.resolver());
// block the current fiber only (not the rest of the event loop)
return future.wait();
}
});
But I don't understand how to use it, lol.