Skip to content

Instantly share code, notes, and snippets.

@marcab
marcab / DataSource Listening
Created January 13, 2011 00:05
Notice the number and order of the output.
function run_demo() {
var k = new goog.ds.JsDataSource([], 'mypath');
goog.ds.DataManager.getInstance().addListener(function (a,b) {console.log(a,b);}, k.getDataPath() + '/fi');
k.setChildNode('fee', {'data': 1});
k.setChildNode('fi', {'data': 2});
k.setChildNode('fo', {'data': 3});
k.setChildNode('fum', {'data': 4});