Compare commits

...

1 Commits

1 changed files with 6 additions and 6 deletions

View File

@ -15,15 +15,15 @@ Box.prototype.set = function(newValue) {
}.bind(this);
};
Box.prototype.check = function(predicate) {
return function(f) {
predicate(this.value)(f);
}
Box.prototype.bind = function(f) {
return function(g) {
f(this.value)(g);
}.bind(this);
};
Box.prototype.update = function(modifier) {
return function(f) {
modifier(this.value)(function (newValue) {this.value = newValue; f()});
modifier(this.value)(function (newValue) {this.value = newValue; f()}.bind(this));
}.bind(this);
};
@ -36,7 +36,7 @@ function make(initValue) {
return {
get: box.get.bind(box),
set: box.set.bind(box),
check: box.check.bind(box),
bind: box.bind.bind(box),
update: box.update.bind(box),
};
}