You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async.autoInject({
get_data: function(callback) {
// async code to get some data
callback(null, 'data', 'converted to array');
},
make_folder: function(callback) {
// async code to create a directory to store a file in
// this is run at the same time as getting the data
callback(null, 'folder');
},
write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
callback(null, 'filename');
}],
email_link: ['write_file', function(write_file, callback) {
callback(null, {'file':write_file, 'email':'[email protected]'});
}]
//...
}, ['email_link', function(err, email_link) {
console.log('err = ', err);
console.log('email_link = ', email_link);
}]);
This doesn't fire callback but removing last callback with following normal format will do it.
Also, final callback doesn't provide result of a particular task but final result of the last task that were performed. Below will output same data like email_link.
Which version are you using exactly? 2.2.0 doesn't exist.
We don't support the array-form for the final callback. The final callback is always of the form function (err, results) {...}, where results is an object of all the results, similar to auto.
Sorry, I am using v2.0.0-rc.6. Btw, as from documentation, it says that later parameter in main callback after err are task names whose results you are interested in. But that is not working for me.
I am using v2.2.0 on client side.
This doesn't fire callback but removing last callback with following normal format will do it.
I guess there is something off there
The text was updated successfully, but these errors were encountered: