Add set() functionality

This commit is contained in:
Daniel Lugo 2021-09-12 17:22:34 -04:00
parent 40db2cc97d
commit 58c3c73497

View file

@ -349,7 +349,17 @@ function createReplica(path, afterMap = false) {
if (afterMap) {
throw new Error('Cannot call set() after map() on a GunSmith node')
}
return this
// @ts-expect-error
const uuid = Gun.text.random()
return this.put(
{
[uuid]: data
},
ack => {
// eslint-disable-next-line no-unused-expressions
cb && cb(ack)
}
)
},
user(pub) {
if (path !== '$root') {