Async is a utility module that provides powerful, straight-forward functions for working with asynchronous JavaScript.
The default code for this method is reflectAll
:
export default function
// tasks is the parameters
reflectAll(tasks) {
var results;
// if it's an array, simply perform reflect on the whole array
if (Array.isArray(tasks)) {
results = tasks.map(reflect);
} else {
// otherwise, call reflect individually on each task and store it in an array
results = {};
Object.keys(tasks).forEach(key => {
results[key] = reflect.call(this, tasks[key]);
});
}
return results;
}
For more information, click here.
Free Resources