This commit is contained in:
Mark Nadal 2019-09-30 13:36:47 -07:00
commit 4ffcc5b17a

View File

@ -1,4 +1,4 @@
/* Promise Library v1.0 for GUN DB
/* Promise Library v1.1 for GUN DB
* Turn any part of a gun chain into a promise, that you can then use
* .then().catch() pattern.
* In normal gun doing var item = gun.get('someKey'), gun returns a reference
@ -67,7 +67,7 @@ Gun.chain.promPut = async function (item, opt) {
var gun = this;
return (new Promise((res, rej)=>{
gun.put(item, function(ack) {
if(ack.err){rej(ack.err)}
if(ack.err){console.log(ack.err); ack.ok=-1; res({ref:gun, ack:ack})}
res({ref:gun, ack:ack});
}, opt);
}))