mirror of
https://github.com/amark/gun.git
synced 2025-10-14 00:59:35 +00:00
kick-blanking, context variables, and bidirectional key/set set/key load/set working!
This commit is contained in:
parent
1ded3ca5eb
commit
a23dd0e5cb
2
gun.js
2
gun.js
@ -411,7 +411,6 @@
|
|||||||
if(!gun._.field){
|
if(!gun._.field){
|
||||||
Gun.obj.map(gun._.keys, function(yes, key){
|
Gun.obj.map(gun._.keys, function(yes, key){
|
||||||
if(yes){ return }
|
if(yes){ return }
|
||||||
console.log("setting fields", key, yes);
|
|
||||||
gun.key(key);
|
gun.key(key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -640,7 +639,6 @@
|
|||||||
(chain._ = chain._ || {})[where] = chain._[where] || [];
|
(chain._ = chain._ || {})[where] = chain._[where] || [];
|
||||||
chain.$[where] = chain.$[where] || function(fn){
|
chain.$[where] = chain.$[where] || function(fn){
|
||||||
if(chain.args){
|
if(chain.args){
|
||||||
//console.log("shoot!", chain.args);
|
|
||||||
fn.apply(chain, chain.args);
|
fn.apply(chain, chain.args);
|
||||||
} else {
|
} else {
|
||||||
(chain._[where]||[]).push(fn);
|
(chain._[where]||[]).push(fn);
|
||||||
|
@ -354,6 +354,20 @@ describe('Gun', function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('load path empty set', function(done){
|
||||||
|
gun.load('hello/world').path('earth').set('mars').get(function(val){
|
||||||
|
expect(val).to.be('mars');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('load path get', function(done){
|
||||||
|
gun.load('hello/world').path('earth').get(function(val){
|
||||||
|
expect(val).to.be('mars');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('key set get', function(done){
|
it('key set get', function(done){
|
||||||
gun.key('world/hello').set({world: "hello"}).get(function(val){
|
gun.key('world/hello').set({world: "hello"}).get(function(val){
|
||||||
expect(val.world).to.be('hello');
|
expect(val.world).to.be('hello');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user