创建嵌套节点
var app = gun.get('app');
var node = app.get('watcher/1').put({"stats":{"num":3},"name":"trex"});
收听更新
app.get('watcher/' + id).get('stats').on(function (v, k) {
console.log('v:', v);
console.log('k:', k);
});
获取网页加载更新(devtools控制台输出)
(index):62 v: {"_":{"#":"j9782ilz019k9aUsJJj5c8Q5O",">":{"num":1508946976437}},"num":3}
(index):63 k: stats
更新节点
app.get('watcher/1').put({"stats":{"num":4},"name":"trexxx"});
控制台没有更新!
jsfiddle demo:https://jsfiddle.net/sergibondarenko/e6ctqaqL/69/
答案 0 :(得分:1)
@trex这是您找到的错误,现在已修复为v0.8.9
+。