implement when-handler

This commit is contained in:
Kevin Jahns
2018-01-18 18:44:20 +01:00
parent 0b510b64a3
commit fc3a4c376c
3 changed files with 48 additions and 2 deletions

View File

@@ -62,6 +62,15 @@ export default class Y extends NamedEventHandler {
this.emit('content')
}
}
whenContentReady () {
if (this._contentReady) {
return Promise.resolve()
} else {
return new Promise(resolve => {
this.once('content', resolve)
})
}
}
_beforeChange () {}
transact (f, remote = false) {
let initialCall = this._transaction === null