aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-03-13 07:24:39 +0100
committerHayleigh Thompson <me@hayleigh.dev>2024-03-13 07:24:39 +0100
commit8ab89947b1cec1b3705b0566a869c4004e94c60c (patch)
tree7c12b62e06e8fbdd91a2910f60487d1967a3a945
parente59b3792c3375d102a1715fd977b58b2521281e7 (diff)
downloadlustre-8ab89947b1cec1b3705b0566a869c4004e94c60c.tar.gz
lustre-8ab89947b1cec1b3705b0566a869c4004e94c60c.zip
:recycle: Tidy up unused import warnings when using lustre for js target.
-rw-r--r--src/lustre/internals/runtime.gleam8
-rw-r--r--src/lustre/server_component.gleam3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lustre/internals/runtime.gleam b/src/lustre/internals/runtime.gleam
index a2b5365..95a17a8 100644
--- a/src/lustre/internals/runtime.gleam
+++ b/src/lustre/internals/runtime.gleam
@@ -52,7 +52,7 @@ pub type DebugAction {
// ACTOR -----------------------------------------------------------------------
-@target(erlang)
+// @target(erlang)
///
///
pub fn start(
@@ -87,7 +87,7 @@ pub fn start(
actor.start_spec(Spec(init, timeout, loop))
}
-@target(erlang)
+// @target(erlang)
fn loop(
message: Action(msg, runtime),
state: State(model, msg, runtime),
@@ -203,7 +203,7 @@ fn loop(
// UTILS -----------------------------------------------------------------------
-@target(erlang)
+// @target(erlang)
fn run_renderers(
renderers: Dict(any, fn(Patch(msg)) -> Nil),
patch: Patch(msg),
@@ -212,7 +212,7 @@ fn run_renderers(
renderer(patch)
}
-@target(erlang)
+// @target(erlang)
fn run_effects(effects: Effect(msg), self: Subject(Action(msg, runtime))) -> Nil {
let dispatch = fn(msg) { actor.send(self, Dispatch(msg)) }
let emit = fn(name, event) { actor.send(self, Emit(name, event)) }
diff --git a/src/lustre/server_component.gleam b/src/lustre/server_component.gleam
index d478e19..363c662 100644
--- a/src/lustre/server_component.gleam
+++ b/src/lustre/server_component.gleam
@@ -21,7 +21,10 @@ import lustre/attribute.{type Attribute, attribute}
import lustre/effect.{type Effect}
import lustre/element.{type Element, element}
import lustre/internals/constants
+@target(erlang)
import lustre/internals/runtime.{type Action, Attrs, Event, SetSelector}
+@target(javascript)
+import lustre/internals/runtime.{type Action, Attrs, Event}
import lustre/internals/patch
// ELEMENTS --------------------------------------------------------------------