diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2023-04-27 21:52:15 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2023-04-27 21:52:15 +0100 |
commit | 10bc93f41efdd9aab25e1e0d29b02b3b961158c5 (patch) | |
tree | 9d9c8fc3daf61326b7ebe4781be8d58e7dc8444a /src/lustre.gleam | |
parent | 19ec0b446041f77a623e574656442c76d75107ae (diff) | |
download | lustre-10bc93f41efdd9aab25e1e0d29b02b3b961158c5.tar.gz lustre-10bc93f41efdd9aab25e1e0d29b02b3b961158c5.zip |
:bookmark: Code for 3.0.0-rc.13.0.0-rc.1
Diffstat (limited to 'src/lustre.gleam')
-rw-r--r-- | src/lustre.gleam | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lustre.gleam b/src/lustre.gleam index bdf6225..54f6c55 100644 --- a/src/lustre.gleam +++ b/src/lustre.gleam @@ -4,7 +4,7 @@ import lustre/cmd.{Cmd} import lustre/element.{Element} -import gleam/result +import gleam/javascript/promise.{Promise} // TYPES ----------------------------------------------------------------------- @@ -242,16 +242,12 @@ pub fn application( /// function from your `main` (or elsewhere) you can get events into your Lustre /// app from the outside world. /// -pub fn start( - app: App(model, msg), - selector: String, -) -> Result(fn(msg) -> Nil, Error) { +pub fn start(app: App(model, msg), selector: String) -> Promise(fn(msg) -> Nil) { mount(app, selector) - |> result.replace_error(ElementNotFound) } external fn mount( app: App(model, msg), selector: String, -) -> Result(fn(msg) -> Nil, Nil) = - "./ffi.mjs" "mount" +) -> Promise(fn(msg) -> Nil) = + "./lustre.ffi.mjs" "mount" |