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) {
this.once((data, key) => {
if (isPopulated(data) || _wait > 100000) {
cb(data, key)
} else {
forge()
isReady().then(() => {
this.specialOnce(cb, _wait * 3)
})
}
})
this.once(
(data, key) => {
if (isPopulated(data) || _wait > 100000) {
cb(data, key)
} else {
forge()
isReady().then(() => {
this.specialOnce(cb, _wait * 3)
})
}
},
{ wait: _wait }
)
return this
},
specialThen() {