summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-03-09 13:06:28 -0800
committerAlexander Early <alexander.early@gmail.com>2016-03-09 13:06:28 -0800
commitdf31042d689ba51e383209b2836ad971c11dee07 (patch)
tree7714cf6b84b2e6efea44d5a7216e2383baf085f5 /README.md
parent27230c22ccc567f7944b0dc7be23148c5e7304b0 (diff)
downloadasync-df31042d689ba51e383209b2836ad971c11dee07.tar.gz
remove ES6 idiomsautoinject
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 1 insertions, 5 deletions
diff --git a/README.md b/README.md
index fab0a74..b872bc8 100644
--- a/README.md
+++ b/README.md
@@ -1470,19 +1470,15 @@ async.autoInject({
});
```
-If you are using a minifier that mangles parameter names, `autoInject` will not work with plain functions. To work around this, you can explicitly specify the names of the parameters 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.
```js
async.autoInject({
//...
write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
callback(null, 'filename');
}],
email_link: ['write_file', function(write_file, callback){
- // once the file is written let's email a link to it...
- // write_file contains the filename returned by write_file.
callback(null, {'file':write_file, 'email':'user@example.com'});
}]
//...