mirror of
https://github.com/amark/gun.git
synced 2025-06-07 06:36:46 +00:00
merge again
This commit is contained in:
parent
6b054146c8
commit
914cce726b
5
gun.js
5
gun.js
@ -926,6 +926,7 @@
|
|||||||
}
|
}
|
||||||
function get(at, cat){
|
function get(at, cat){
|
||||||
var soul = at.get[_soul], node = cat.graph[soul], field = at.get[_field];
|
var soul = at.get[_soul], node = cat.graph[soul], field = at.get[_field];
|
||||||
|
console.debug(2, 'GET', soul, node, field);
|
||||||
if(node && (!field || obj_has(node, field))){
|
if(node && (!field || obj_has(node, field))){
|
||||||
if(field){
|
if(field){
|
||||||
node = Gun.obj.put({_: node._}, field, node[field]);
|
node = Gun.obj.put({_: node._}, field, node[field]);
|
||||||
@ -947,6 +948,7 @@
|
|||||||
if(cat.graph){
|
if(cat.graph){
|
||||||
Gun.obj.map(at.put, ham, {at: at, cat: cat}); // all unions must happen first, sadly.
|
Gun.obj.map(at.put, ham, {at: at, cat: cat}); // all unions must happen first, sadly.
|
||||||
}
|
}
|
||||||
|
console.debug(3, 'INPUT', at);
|
||||||
Gun.obj.map(at.put, map, {at: at, cat: cat});
|
Gun.obj.map(at.put, map, {at: at, cat: cat});
|
||||||
}
|
}
|
||||||
function ham(data, key){
|
function ham(data, key){
|
||||||
@ -2198,6 +2200,7 @@
|
|||||||
Attempted merge with alancnet's `off` support, we'll see if it works.
|
Attempted merge with alancnet's `off` support, we'll see if it works.
|
||||||
*/
|
*/
|
||||||
if(opt !== false){
|
if(opt !== false){
|
||||||
|
console.debug(1, 'map!');
|
||||||
ons[ons.length] = gun.on(map, {change: true, as: cat});
|
ons[ons.length] = gun.on(map, {change: true, as: cat});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2224,6 +2227,8 @@
|
|||||||
var gun = this.gun, cat = this.cat, id = this.id;
|
var gun = this.gun, cat = this.cat, id = this.id;
|
||||||
if(cat.list[id+f]){ return }
|
if(cat.list[id+f]){ return }
|
||||||
// TODO: BUG! Ghosting!
|
// TODO: BUG! Ghosting!
|
||||||
|
console.debug(5, 'EACH', f,v);
|
||||||
|
console.debug(4, 'EACH', f,v);
|
||||||
return cat.on('in', {gun: (cat.list[id+f] = gun.path(f)), get: f, put: v, via: this.at});
|
return cat.on('in', {gun: (cat.list[id+f] = gun.path(f)), get: f, put: v, via: this.at});
|
||||||
//return cat.on('in', [id+f, {gun: (cat.list[id+f] = gun.path(f)), get: f, put: v}]);
|
//return cat.on('in', [id+f, {gun: (cat.list[id+f] = gun.path(f)), get: f, put: v}]);
|
||||||
}
|
}
|
||||||
|
@ -1731,6 +1731,7 @@ describe('Gun', function(){
|
|||||||
}
|
}
|
||||||
}, s)});
|
}, s)});
|
||||||
var check = {};
|
var check = {};
|
||||||
|
console.debug.i=1;
|
||||||
(window.FOO = gun.get('u/m/p/n/mutate/n/u').map().path('pet')).on(function(v,f){
|
(window.FOO = gun.get('u/m/p/n/mutate/n/u').map().path('pet')).on(function(v,f){
|
||||||
check[v.name] = f;
|
check[v.name] = f;
|
||||||
console.log("************", f,v);return;
|
console.log("************", f,v);return;
|
||||||
@ -1744,6 +1745,7 @@ describe('Gun', function(){
|
|||||||
},100);
|
},100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
//gun.get('u/m/p/n/m/n/u/soul').path('alice').path('pet').on(function(v){console.log("?????????????????????????????????????????", v)})
|
//gun.get('u/m/p/n/m/n/u/soul').path('alice').path('pet').on(function(v){console.log("?????????????????????????????????????????", v)})
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
var s = Gun.state.map();s.soul = 'alice/fuzz/soul';
|
var s = Gun.state.map();s.soul = 'alice/fuzz/soul';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user