brisky-struct
Advanced tools
Comparing version 0.0.22 to 0.0.23
const { diff } = require('./diff') | ||
const remove = require('./property/remove') | ||
const { update } = require('./property') | ||
const { origin } = require('../compute') | ||
@@ -42,2 +43,3 @@ const driver = (t, type) => {} | ||
const branch = tree[key] = { _p: tree, _key: key, $subs: subs } | ||
if (origin(t) !== t) { tree[key].$origin = origin(t) } | ||
return diff(t, subs, cb, branch, void 0, composite) | ||
@@ -60,3 +62,3 @@ } | ||
return true | ||
} else if (isSwitched(branch.$subs, result)) { | ||
} else if (isSwitched(branch.$subs, result, branch, t)) { | ||
remove(branch.$subs, cb, branch) | ||
@@ -72,3 +74,12 @@ update(key, t, result, cb, tree, void 0, composite) | ||
const isSwitched = (a, b) => { | ||
const isSwitched = (a, b, branch, t) => { | ||
if (t) { | ||
let o = origin(t) | ||
let b = branch.$origin | ||
if (b && b !== o || o !== t) { | ||
branch.$origin = o | ||
return true | ||
} | ||
} | ||
if (a === b) { | ||
@@ -75,0 +86,0 @@ return false // test |
{ | ||
"name": "brisky-struct", | ||
"description": "An observable data structure", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -14,4 +14,4 @@ require('./types') | ||
require('./context') | ||
require('./subscribe') | ||
require('./props') | ||
require('./async') | ||
require('./subscribe') |
require('./basic') | ||
require('./remove') | ||
require('./any') | ||
require('./references') |
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
347638
94
6652