Make async return the last value of a sequence

This commit is contained in:
Tissevert 2018-12-02 19:44:56 +01:00
parent e7efd4b524
commit 938c4d9aaa
1 changed files with 2 additions and 2 deletions

View File

@ -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();