mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
10 lines
253 B
JavaScript
10 lines
253 B
JavaScript
|
|
var Gun = require('./sea').Gun;
|
|
Gun.chain.then = function(cb, opt = {}){
|
|
opt = {wait: 200, ...opt}
|
|
var gun = this, p = (new Promise(function(res, rej){
|
|
gun.once(res, opt);
|
|
}));
|
|
return cb? p.then(cb) : p;
|
|
}
|
|
|