Browse Source

Fix persistent state bug preventing to run named sequences and bindings twice

main
Tissevert 2 years ago
parent
commit
a74b0cc480
  1. 6
      src/UnitJS/Async.js

6
src/UnitJS/Async.js

@ -18,14 +18,14 @@ function apply(f, x) {
}
function bind() {
var m, steps, i;
var m, steps;
if(arguments.length < 1) {
return wrap();
}
m = arguments[0];
steps = arguments;
i = 1;
return function(f) {
var i = 1;
var step = function(x) {
if(i < steps.length) {
steps[i++](x)(step);
@ -87,8 +87,8 @@ function run() {
function sequence() {
var steps = arguments;
var i = 0;
return function(f) {
var i = 0;
var step = function(x) {
if(i < steps.length) {
steps[i++](step);

Loading…
Cancel
Save