Support clamping in MutableBag's change method

This commit is contained in:
Tony Garnock-Jones 2018-11-04 19:30:23 +00:00
parent 2133512ef2
commit aad64bf33c
1 changed files with 2 additions and 2 deletions

View File

@ -32,9 +32,9 @@ function MutableBag(s) {
this._items = s ? fromSet(s) : Immutable.Map();
}
MutableBag.prototype.change = function (key, delta) {
MutableBag.prototype.change = function (key, delta, clamp) {
var net;
({bag: this._items, net: net} = change(this._items, key, delta));
({bag: this._items, net: net} = change(this._items, key, delta, clamp));
return net;
};