diff --git a/packages/core/src/dataspace.js b/packages/core/src/dataspace.js index 660f34a..8eb633e 100644 --- a/packages/core/src/dataspace.js +++ b/packages/core/src/dataspace.js @@ -18,7 +18,7 @@ //--------------------------------------------------------------------------- const Immutable = require("immutable"); -const { fromJS } = require("preserves"); +const Preserves = require("preserves"); const Skeleton = require('./skeleton.js'); const $Special = require('./special.js'); @@ -130,7 +130,10 @@ Dataspace.declareField = function (obj, prop, init) { obj, prop, init, - { objectId: Immutable.List.of(obj, prop) }); + { + objectId: Immutable.List.of(obj, prop), + noopGuard: Preserves.is + }); } }; @@ -344,14 +347,14 @@ Actor.prototype.assert = function (a) { this.pendingPatch().adjust(a, +1); }; Actor.prototype.retract = function (a) { this.pendingPatch().adjust(a, -1); }; Actor.prototype.adhocRetract = function (a) { - a = fromJS(a); + a = Preserves.fromJS(a); if (this.adhocAssertions.change(a, -1, true) === Bag.PRESENT_TO_ABSENT) { this.retract(a); } }; Actor.prototype.adhocAssert = function (a) { - a = fromJS(a); + a = Preserves.fromJS(a); if (this.adhocAssertions.change(a, +1) === Bag.ABSENT_TO_PRESENT) { this.assert(a); } @@ -374,7 +377,7 @@ Patch.prototype.perform = function (ds, ac) { Patch.prototype.adjust = function (a, count) { if (a !== void 0) { var _net; - ({bag: this.changes, net: _net} = Bag.change(this.changes, fromJS(a), count)); + ({bag: this.changes, net: _net} = Bag.change(this.changes, Preserves.fromJS(a), count)); } }; @@ -384,7 +387,7 @@ function Message(body) { Message.prototype.perform = function (ds, ac) { if (this.body !== void 0) { - ds.sendMessage(fromJS(this.body)); + ds.sendMessage(Preserves.fromJS(this.body)); } }; @@ -617,7 +620,7 @@ Endpoint.prototype._uninstall = function (ds, ac, emitPatches) { Endpoint.prototype.refresh = function (ds, ac, facet) { let [newAssertion, newHandler] = this.updateFun.call(facet.fields); - if (newAssertion !== void 0) newAssertion = fromJS(newAssertion); + if (newAssertion !== void 0) newAssertion = Preserves.fromJS(newAssertion); if (!Immutable.is(newAssertion, this.assertion)) { this._uninstall(ds, ac, true); this._install(ds, ac, newAssertion, newHandler);