3 ms·
In conjunction with the Promises library (http://github.com/ShiftSpace/promises http://github.com/ShiftSpace/promises) you can also do things like the following
by swannodette 17y ago
In conjunction with the Promises library (http://github.com/ShiftSpace/promises http://github.com/ShiftSpace/promises) you can also do things like the following:
var sum = $arity(
function(a) { return a; },
function(a, b) { return add(a, b.first()); }
);
var lazyValues = [$lazy(), $lazy(), $lazy()];
var sum = $reduce(sum, lazyValues);
lazyValues[0].setValue(10);
lazyValues[1].setValue(2);
lazyValues[2].setValue(3);
sum.value(); // 15