Actually pass through wait

This commit is contained in:
Daniel Lugo 2021-09-16 11:58:09 -04:00
parent dd79430e42
commit 03790b46b5

View file

@ -561,16 +561,19 @@ function createReplica(path, afterMap = false) {
}) })
}, },
specialOnce(cb, _wait = 1000) { specialOnce(cb, _wait = 1000) {
this.once((data, key) => { this.once(
if (isPopulated(data) || _wait > 100000) { (data, key) => {
cb(data, key) if (isPopulated(data) || _wait > 100000) {
} else { cb(data, key)
forge() } else {
isReady().then(() => { forge()
this.specialOnce(cb, _wait * 3) isReady().then(() => {
}) this.specialOnce(cb, _wait * 3)
} })
}) }
},
{ wait: _wait }
)
return this return this
}, },
specialThen() { specialThen() {