diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lustre.gleam | 4 | ||||
-rw-r--r-- | src/lustre/attribute.gleam | 11 | ||||
-rw-r--r-- | src/lustre/element.gleam | 9 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/lustre.gleam b/src/lustre.gleam index 523fce4..0c3f2ec 100644 --- a/src/lustre.gleam +++ b/src/lustre.gleam @@ -4,7 +4,7 @@ // IMPORTS --------------------------------------------------------------------- import gleam/dynamic.{type Decoder} -import gleam/map.{type Map} +import gleam/dict.{type Dict} import lustre/effect.{type Effect} import lustre/element.{type Element} @@ -81,7 +81,7 @@ pub fn component( _init: fn() -> #(model, Effect(msg)), _update: fn(model, msg) -> #(model, Effect(msg)), _view: fn(model) -> Element(msg), - _on_attribute_change: Map(String, Decoder(msg)), + _on_attribute_change: Dict(String, Decoder(msg)), ) -> Result(Nil, Error) { Ok(Nil) } diff --git a/src/lustre/attribute.gleam b/src/lustre/attribute.gleam index 9531938..d2099c9 100644 --- a/src/lustre/attribute.gleam +++ b/src/lustre/attribute.gleam @@ -124,13 +124,10 @@ pub fn to_string_builder(attr: Attribute(msg)) -> StringBuilder { /// pub fn style(properties: List(#(String, String))) -> Attribute(msg) { - attribute( - "style", - { - use styles, #(name, value) <- list.fold(properties, "") - styles <> name <> ":" <> value <> ";" - }, - ) + attribute("style", { + use styles, #(name, value) <- list.fold(properties, "") + styles <> name <> ":" <> value <> ";" + }) } /// diff --git a/src/lustre/element.gleam b/src/lustre/element.gleam index 25b84b4..1d18825 100644 --- a/src/lustre/element.gleam +++ b/src/lustre/element.gleam @@ -186,7 +186,8 @@ fn attrs_to_string_builder( html, class, style, - inner_html <> val, + inner_html + <> val, ) Ok(#("class", val)) if class == "" -> #(html, val, style, inner_html) Ok(#("class", val)) -> #(html, class <> " " <> val, style, inner_html) @@ -210,7 +211,11 @@ fn attrs_to_string_builder( _, _ -> string_builder.append( html, - " class=\"" <> class <> "\" style=\"" <> style <> "\"", + " class=\"" + <> class + <> "\" style=\"" + <> style + <> "\"", ) }, inner_html, |