delay errors in observe callbacks to throw after cleanup is done

This commit is contained in:
Kevin Jahns
2019-10-25 23:44:09 +02:00
parent f4c919d9ec
commit f53dff5043
6 changed files with 226 additions and 134 deletions

View File

@@ -30,7 +30,7 @@ import * as encoding from 'lib0/encoding.js' // eslint-disable-line
* @param {EventType} event
*/
export const callTypeObservers = (type, transaction, event) => {
callEventHandlerListeners(type._eH, event, transaction)
const changedType = type
const changedParentTypes = transaction.changedParentTypes
while (true) {
// @ts-ignore
@@ -40,6 +40,7 @@ export const callTypeObservers = (type, transaction, event) => {
}
type = type._item.parent
}
callEventHandlerListeners(changedType._eH, event, transaction)
}
/**