Make async return the last value of a sequence
This commit is contained in:
parent
e7efd4b524
commit
938c4d9aaa
1 changed files with 2 additions and 2 deletions
|
@ -50,11 +50,11 @@ function Async() {
|
|||
var steps = arguments;
|
||||
var i = 0;
|
||||
return function(f) {
|
||||
var step = function() {
|
||||
var step = function(x) {
|
||||
if(i < steps.length) {
|
||||
steps[i++](step);
|
||||
} else {
|
||||
f();
|
||||
f(x);
|
||||
}
|
||||
}
|
||||
step();
|
||||
|
|
Loading…
Reference in a new issue