diff options
Diffstat (limited to 'src/lustre.ffi.mjs')
-rw-r--r-- | src/lustre.ffi.mjs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lustre.ffi.mjs b/src/lustre.ffi.mjs index 3a6556e..b57026f 100644 --- a/src/lustre.ffi.mjs +++ b/src/lustre.ffi.mjs @@ -1,4 +1,4 @@ -import { morphdom } from "./runtime.ffi.mjs"; +import { morph } from "./runtime.ffi.mjs"; import { Ok, Error } from "./gleam.mjs"; import { map } from "./lustre/element.mjs"; @@ -14,6 +14,10 @@ export class App { #willUpdate = false; #didUpdate = false; + #init = null; + #update = null; + #view = null; + constructor(init, update, render) { this.#init = init; this.#update = update; @@ -51,7 +55,7 @@ export class App { const node = this.#view(this.#state); const vdom = map(node, (msg) => this.dispatch(msg)); - morphdom(this.#root.firstChild, vdom); + morph(this.#root, vdom); } #tick() { |