Hmm. Before G U N chains?

This commit is contained in:
Mark Nadal
2016-05-11 14:45:49 -07:00
parent 9d484787d8
commit cb5738c58f
2 changed files with 18 additions and 3 deletions

17
gun.js
View File

@@ -862,9 +862,24 @@
};
}());
;(function(){
function key(err, node){ // TODO: Belongs someplace else!
var at = this;
var pseudo = is_node_ify({}, is_node_soul(node));
console.log("--------------------------------------------------")
is_node(node, function(n, f){
n = at.gun.__.graph[f];
console.log("oh", n);
is_node(n, function(v, f){
console.log(v, f, is_node_state(n, f));
is_node_state_ify(pseudo, {field: f, value: v, state: is_node_state(n, f) })
});
});
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", pseudo, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
}
function got(err, node){
var at = this;// opt = at.opt, cb;
at.on('any', [err, node]);
key.call(at, err, node);
at.on('any', [err, at.node]);
at.on('chain', at);
}
function cache(by, soul, back){

View File

@@ -1471,12 +1471,12 @@ describe('Gun', function(){
});
it('put node key get', function(done){
Gun.log.debug = 1; console.log("-----------------------");
Gun.log.debug = 1; window.gun = gun; console.log("-----------------------");
gun.put({hello: "key"}).key('yes/key', function(err, ok){
console.log("****************************", err, ok);
expect(err).to.not.be.ok();
done.w = 1; if(done.c){ return } if(done.r){ done(); done.c = 1 };
}); return; gun.get('yes/key', function(err, node){ // CHANGELOG: API 0.3 BREAKING CHANGE FROM err, graph
}).get('yes/key', function(err, node){ // CHANGELOG: API 0.3 BREAKING CHANGE FROM err, graph
console.log("2 ****************************", err, node);
console.log('oye', err, node);
expect(err).to.not.be.ok();