Restore then() functionality

This commit is contained in:
Daniel Lugo 2021-09-12 17:51:02 -04:00
parent 70adbecc5a
commit 58d7ba1237
2 changed files with 8 additions and 0 deletions

View file

@ -400,6 +400,13 @@ function createReplica(path, afterMap = false) {
)
}
}
},
then() {
return new Promise(res => {
this.once(data => {
res(data)
})
})
}
}
}

View file

@ -70,6 +70,7 @@ namespace GunT {
user(pub: string): GUNNode
put(data: ValidDataValue, cb?: Callback): GUNNode
set(data: ValidDataValue, cb?: Callback): GUNNode
then(): Promise<ListenerData>
}
export interface CreateAck {