diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2023-12-22 01:10:59 +0000 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2023-12-22 11:01:21 +0000 |
commit | 76a166736135a522a740b24d776a2e3b9656fdbd (patch) | |
tree | 75d7fa60c69f850dd2e46a386ae5ed3db0eb4438 /src | |
parent | fb0e3a9b1835dc30ba196ddb630f02f9d554978a (diff) | |
download | lustre-76a166736135a522a740b24d776a2e3b9656fdbd.tar.gz lustre-76a166736135a522a740b24d776a2e3b9656fdbd.zip |
:heavy_plus_sign: Upgrade to Gleam v0.33.0
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, |