summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Robb <softnfuzzyrobb@gmail.com>2016-04-06 02:45:13 +0100
committerSteve Robb <softnfuzzyrobb@gmail.com>2016-04-06 02:45:13 +0100
commit3e33843000cba809a52364f10cbb48b385025b46 (patch)
tree29a24d57b15b85a9d8f38dd632ec7ffd7e28869d
parentb5bba26894d454183070c7e9f5cf456b05a6f1b3 (diff)
downloadasync-3e33843000cba809a52364f10cbb48b385025b46.tar.gz
Docs updated to include injected results into final callback.
-rw-r--r--README.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/README.md b/README.md
index 77de89f..93c7a2f 100644
--- a/README.md
+++ b/README.md
@@ -1532,7 +1532,7 @@ async.autoInject({
});
```
-If you are using a JS minifier that mangles parameter names, `autoInject` will not work with plain functions, since the parameter names will be collapsed to a single letter identifier. To work around this, you can explicitly specify the names of the parameters your task function needs in an array, similar to Angular.js dependency injection.
+If you are using a JS minifier that mangles parameter names, `autoInject` will not work with plain functions, since the parameter names will be collapsed to a single letter identifier. To work around this, you can explicitly specify the names of the parameters your task function needs in an array, similar to Angular.js dependency injection. The final results callback can be provided as an array in the same way.
```js
async.autoInject({
@@ -1544,7 +1544,10 @@ async.autoInject({
callback(null, {'file':write_file, 'email':'user@example.com'});
}]
//...
-}, done);
+}, ['email_link', function(err, email_link) {
+ console.log('err = ', err);
+ console.log('email_link = ', email_link);
+}]);
```
This still has an advantage over plain `auto`, since the results a task depends on are still spread into arguments.