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

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