Comparing version 0.9.9 to 0.9.10
@@ -114,2 +114,6 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
Scope.prototype.setRoot = function(modelObject, callback) { | ||
if (this._rootModelObjectUUID) { | ||
return callbackOrEmitError(this, callback, new Error('Already has root modelObject set')); | ||
} | ||
// Will call addModelObjectAsRootModelObject and set the modelObject.scope property | ||
@@ -119,2 +123,16 @@ modelObject.setScopeAndMakeRootModel(this, callback); | ||
Scope.prototype.removeRoot = function(callback) { | ||
if (!this._rootModelObjectUUID) { | ||
return callbackOrEmitError(this, callback, new Error('No root modelObject to remove')); | ||
} | ||
// Will unset the modelObject.scope property | ||
this.getRootModelObject(function(err, modelObject) { | ||
if (err) { | ||
return callbackOrEmitError(this, callback, err); | ||
} | ||
modelObject.setScope(null, callback); | ||
}.bind(this)); | ||
}; | ||
Scope.prototype.addModelObjectAsRootModelObject = function(modelObject, callback) { | ||
@@ -121,0 +139,0 @@ if (this._rootModelObjectUUID) { |
{ | ||
"name": "jetstream", | ||
"version": "0.9.9", | ||
"version": "0.9.10", | ||
"description": "Jetstream Sync server framework to sync local and remote models", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
505974
11323