aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/src/lustre.ffi.mjs3
-rw-r--r--lib/src/lustre.gleam3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/src/lustre.ffi.mjs b/lib/src/lustre.ffi.mjs
index 51a6e26..29a60a9 100644
--- a/lib/src/lustre.ffi.mjs
+++ b/lib/src/lustre.ffi.mjs
@@ -122,7 +122,8 @@ export class App {
}
export const setup = (init, update, render) => new App(init, update, render);
-export const start = (app, selector) => app.start(selector);
+export const start = (app, selector, flags) => app.start(selector, flags);
+export const destroy = (app) => app.destroy();
export const emit = (name, data) =>
// Normal `Effect`s constructed in Gleam from `effect.from` don't get told
diff --git a/lib/src/lustre.gleam b/lib/src/lustre.gleam
index 2585a5b..a8bdfd9 100644
--- a/lib/src/lustre.gleam
+++ b/lib/src/lustre.gleam
@@ -247,6 +247,9 @@ pub fn start(
flags: flags,
) -> Result(fn(msg) -> Nil, Error)
+@external(javascript, "./lustre.ffi.mjs", "destroy")
+pub fn destroy(app: App(flags, model, msg)) -> Nil
+
// UTILS -----------------------------------------------------------------------
@external(javascript, "./lustre.ffi.mjs", "is_browser")