mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Add .map to Chain
This commit is contained in:
parent
3cbd827b20
commit
96be393bdc
16
gun.js
16
gun.js
@ -459,6 +459,22 @@
|
||||
this._.dud = Gun.fns.is(dud)? dud : function(){};
|
||||
return this;
|
||||
}
|
||||
Chain.map = function(cb){
|
||||
var gun = this;
|
||||
gun.shot.then(function(val){
|
||||
cb = cb || function(){};
|
||||
//console.log("map module is loading", val);
|
||||
Gun.obj.map(val, function(obj, soul){
|
||||
//console.log(obj, Gun.is.soul(obj));
|
||||
if(!Gun.is.soul(obj)){ return; }
|
||||
gun.load(obj).get(function(obj){
|
||||
delete obj._;
|
||||
cb.call(this, obj, soul);
|
||||
});
|
||||
});
|
||||
});
|
||||
return gun;
|
||||
}
|
||||
}(Gun.chain = Gun.prototype));
|
||||
;(function(Util){
|
||||
Util.fns = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user