Search code examples
javascriptgun

Nested object is not updated


Create a nested node

var app = gun.get('app');
var node = app.get('watcher/1').put({"stats":{"num":3},"name":"trex"});

Listen to updates

app.get('watcher/' + id).get('stats').on(function (v, k) {
  console.log('v:', v); 
  console.log('k:', k);
});

Get the update on web page load (the devtools console output)

(index):62 v: {"_":{"#":"j9782ilz019k9aUsJJj5c8Q5O",">":{"num":1508946976437}},"num":3}
(index):63 k: stats

Update the node

app.get('watcher/1').put({"stats":{"num":4},"name":"trexxx"});

No updates in the console!

jsfiddle demo: https://jsfiddle.net/sergibondarenko/e6ctqaqL/69/


Solution

  • @trex this was a bug you found, and is now fixed in v0.8.9+.