Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "baobab", | ||
"main": "build/baobab.min.js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/Yomguithereal/baobab", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -9,5 +9,5 @@ { | ||
"mixins": [], | ||
"shiftReferences": true, | ||
"shiftReferences": false, | ||
"typology": null, | ||
"validate": null | ||
} |
@@ -12,3 +12,3 @@ /** | ||
Object.defineProperty(Baobab, 'version', { | ||
value: '0.3.0' | ||
value: '0.3.1' | ||
}); | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "baobab", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "JavaScript data tree with cursors.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -132,2 +132,6 @@ /** | ||
// Shifting root reference | ||
if (this.options.shiftReferences) | ||
this.data = helpers.shallowClone(this.data); | ||
// Applying modification (mutation) | ||
@@ -134,0 +138,0 @@ var record = this._archive(); |
@@ -35,3 +35,3 @@ /** | ||
// Root listeners | ||
this.root.on('update', function(e) { | ||
this.updateHandler = function(e) { | ||
var log = e.data.log, | ||
@@ -92,4 +92,7 @@ shouldFire = false, | ||
} | ||
}); | ||
}; | ||
// Listening | ||
this.root.on('update', this.updateHandler); | ||
// Making mixin | ||
@@ -306,7 +309,9 @@ this.mixin = mixins.cursor(this); | ||
/** | ||
* Type definition | ||
* Releasing | ||
*/ | ||
types.add('cursor', function(v) { | ||
return v instanceof Cursor; | ||
}); | ||
Cursor.prototype.release = function() { | ||
this.root.off('update', this.updateHandler); | ||
this.root = null; | ||
this.unbindAll(); | ||
}; | ||
@@ -321,4 +326,11 @@ /** | ||
/** | ||
* Type definition | ||
*/ | ||
types.add('cursor', function(v) { | ||
return v instanceof Cursor; | ||
}); | ||
/** | ||
* Export | ||
*/ | ||
module.exports = Cursor; |
@@ -44,5 +44,3 @@ /** | ||
k, | ||
v, | ||
i, | ||
l; | ||
v; | ||
@@ -111,3 +109,2 @@ for (k in spec) { | ||
'$unshift' in (spec[k] || {}))) { | ||
if ('$push' in (spec[k] || {})) { | ||
@@ -137,2 +134,6 @@ v = spec[k].$push; | ||
// Shifting reference | ||
if (opts.shiftReferences) | ||
o[k] = helpers.shallowClone(o[k]); | ||
// Recur | ||
@@ -139,0 +140,0 @@ mutator( |
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
54868
1230