This commit is contained in:
Daniel Lugo 2021-09-12 17:26:48 -04:00
parent 58c3c73497
commit 70adbecc5a

View file

@ -301,10 +301,11 @@ function createReplica(path, afterMap = false) {
return this
},
once(cb, opts = { wait: 500 }) {
// We could use this.on() but then we couldn't call .off()
const tmp = createReplica(path, afterMap)
if (afterMap) {
// TODO
} else {
throw new Error('Cannot call once() after map() on a GunSmith node')
}
/** @type {GunT.ListenerData} */
let lastVal = null
@ -318,7 +319,7 @@ function createReplica(path, afterMap = false) {
}
tmp.off()
}, opts.wait)
}
return this
},
put(data, cb) {