From 42067167e278fef921a07addf974f2b278944222 Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Wed, 19 Jul 2023 10:48:10 +0100 Subject: :alembic: Maybe we can just roll our own DOM patching? --- src/lustre.ffi.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lustre.ffi.mjs') 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() { -- cgit v1.2.3