Skip to content

Commit

Permalink
force bump base-iterator, update example
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Mar 16, 2016
1 parent e07156e commit a0c3942
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"app-base": "github:tunnckocore/app-base",
"async": "^1.5.2",
"async-base-iterator": "^0.1.1",
"async-base-iterator": "^0.2.0",
"extend-shallow": "^2.0.1",
"lazy-cache": "^1.0.3"
},
Expand Down
22 changes: 15 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,31 @@ var asyncControl = require('./index')
asyncControl.series([
function one (done) {
this.one = 'one'
// console.log('first:', this.one)
console.log('first:', this.one)
// throw new Error('foo')
fs.readFile('package.json', done)
},
function two () {
// console.log(this.one)
function two (a, b, c) {
this.two = 'two'
console.log('second:', this.two)
console.log('args:', a, b, c) // => 1 2 3
// throw new Error('foo')
return fs.readFileSync('not exist', 'utf8')
},
function three (done) {
// console.log(this.two)
function three (a, b, c, done) {
this.three = 'three'
// console.log(this.three)
console.log('third:', this.three)
console.log('ctx:', this)
console.log('args:', a, b, c) // => 1 2 3
fs.readFile('package.json', done)
}
], /* {settle: true}, */ function (err, res) {
], {
settle: true,
params: [1, 2, 3],
context: {
foo: 123
}
}, function (err, res) {
console.log('err:', err) // => ENOENT Error
console.log('res:', res) // => [Buffer, undefined]
console.log('done')
Expand Down

0 comments on commit a0c3942

Please sign in to comment.