add createdProxy event

This commit is contained in:
Philipp Kühn 2020-08-21 23:43:08 +02:00
parent 3cfed6c17f
commit 119f7d1458
2 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@ export class Editor extends EventEmitter {
constructor(options: Partial<EditorOptions> = {}) {
super()
this.options = { ...this.options, ...options }
this.on('createdProxy', this.init)
}
/**

View File

@ -25,7 +25,7 @@ export default function magicMethods(clazz: any) {
}
instance.proxy = new Proxy(instance, instanceHandler)
instance.init()
instance.emit('createdProxy')
return instance.proxy
}