mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge branch 'master' of http://github.com/amark/gun
This commit is contained in:
commit
4ffcc5b17a
@ -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);
|
||||
}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user