aboutsummaryrefslogtreecommitdiff
path: root/src/client-runtime.ffi.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client-runtime.ffi.mjs')
-rw-r--r--src/client-runtime.ffi.mjs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client-runtime.ffi.mjs b/src/client-runtime.ffi.mjs
index 12c8627..ab80fbf 100644
--- a/src/client-runtime.ffi.mjs
+++ b/src/client-runtime.ffi.mjs
@@ -71,8 +71,12 @@ export class LustreClientApplication {
const vdom = this.#view(this.#model);
this.#didUpdate = false;
- this.#root = morph(this.#root, vdom, (msg) => {
- this.send(new Dispatch(msg));
+ this.#root = morph(this.#root, vdom, (handler) => (e) => {
+ const result = handler(e);
+
+ if (result.isOk()) {
+ this.send(new Dispatch(result[0]));
+ }
});
}