hot patch

This commit is contained in:
Kurt Hutten
2020-11-17 18:14:51 +11:00
parent 9708afb1d2
commit 5c177753a7
4 changed files with 10 additions and 9 deletions

View File

@@ -8,17 +8,19 @@ class CascadeController {
}
initialise(onCodeChange, code) {
const onInit = () => {
const editor = getEditor()
editor.setValue(code)
editor.evaluateCode(false)
}
// only inits on first call, after that it just updates the editor and revaluates code, maybe should rename?
this.incomingOnCodeChang = onCodeChange
if (!this._hasInitialised) {
initialize(this.controllerOnCodeChange, code)
initialize(this.controllerOnCodeChange, code, onInit)
this._hasInitialised = true
return
}
const editor = getEditor()
editor.setValue(code)
editor.evaluateCode(false)
return this.domNode
onInit()
}
}