brisky-struct
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -88,3 +88,3 @@ const { getFn } = require('./get') | ||
const setStamp = (t, stamp) => { | ||
t.stamp = t.tStamp = stamp | ||
t.tStamp = stamp | ||
if (t._p) { | ||
@@ -98,2 +98,8 @@ let p = t._p | ||
// no exception for subs | ||
if (p.emitters && p.emitters.data && p.emitters.data.struct) { | ||
let i = p.emitters.data.struct.length | ||
while (i--) { | ||
setStamp(p.emitters.data.struct[i], stamp) | ||
} | ||
} | ||
if (p.subscriptions) { execSubs(p, stamp) } | ||
@@ -110,2 +116,3 @@ p = p._p | ||
if (t.stamp !== stamp) { | ||
t.stamp = stamp | ||
setStamp(t, stamp) | ||
@@ -112,0 +119,0 @@ const own = t.emitters && t.emitters.data |
{ | ||
"name": "brisky-struct", | ||
"description": "An observable data structure", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -14,4 +14,4 @@ require('./context') | ||
require('./remove') | ||
require('./subscribe') | ||
require('./compute') | ||
require('./references') | ||
require('./subscribe') |
require('./basic') | ||
require('./references') | ||
require('./any') | ||
@@ -7,1 +6,2 @@ require('./composite') | ||
require('./method') | ||
require('./references') |
@@ -44,3 +44,2 @@ const test = require('tape') | ||
console.log('\nSTEP ONE') | ||
s( | ||
@@ -199,1 +198,29 @@ 'switch reference', | ||
}) | ||
test('subscription - reference - simple', t => { | ||
const s = subsTest( | ||
t, | ||
{ | ||
clients: { | ||
client: { | ||
menu: true | ||
} | ||
}, | ||
client: [ '@', 'root', 'clients', 'client' ] | ||
}, | ||
{ client: { menu: { val: true } } } // this will not fire ofc | ||
) | ||
s( | ||
'initial subscription', | ||
[ { path: 'clients/client/menu', type: 'new' } ] | ||
) | ||
s( | ||
'remove ref', | ||
[ { path: 'clients/client/menu', type: 'update' } ], | ||
{ clients: { client: { menu: 'hello' } } } | ||
) | ||
t.end() | ||
}) |
@@ -0,2 +1,2 @@ | ||
require('./multiple') | ||
require('./basic') | ||
require('./multiple') |
339975
6302