mirror of
https://github.com/amark/gun.git
synced 2026-03-17 21:58:49 +00:00
Merge branch 'master' of http://github.com/amark/gun
This commit is contained in:
@@ -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);
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user