From 1c80731d39b159e86d24ee9f5e61c58d18e1d81c Mon Sep 17 00:00:00 2001 From: Dmitry Matveyev Date: Wed, 13 Mar 2024 09:25:54 +0300 Subject: =?UTF-8?q?=F0=9F=94=80=20Fix=20quickstart=20typos.=20(#54)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lustre.Element(Msg) -> element.Element(Msg) * quickstart: fix image link in the final example --- pages/guide/01-quickstart.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pages/guide/01-quickstart.md b/pages/guide/01-quickstart.md index 5909ed9..9b0cf94 100644 --- a/pages/guide/01-quickstart.md +++ b/pages/guide/01-quickstart.md @@ -210,7 +210,7 @@ or `Decrement` message when clicked. The Lustre runtime is responsible for attaching these event listeners and calling your `update` function with the resulting message. -> **Note**: notice that the return type of `view` is `lustre.Element(Msg)`. The +> **Note**: notice that the return type of `view` is `element.Element(Msg)`. The > type parameter `Msg` tells us the kinds of messages this element might produce > from events: type safety to the rescue! @@ -341,7 +341,7 @@ Before we forget, let's also update our `view` function to actually display the cat images we're fetching: ```gleam -pub fn view(model: Model) -> lustre.Element(Msg) { +pub fn view(model: Model) -> element.Element(Msg) { let count = int.to_string(model.count) html.div([], [ @@ -352,9 +352,12 @@ pub fn view(model: Model) -> lustre.Element(Msg) { html.button([event.on_click(Decrement)], [ element.text("-") ]), - html.div([], list.map(model.cats, fn(cat) { - html.img([attribute.src(cat)]) - })) + html.div( + [], + list.map(model.cats, fn(cat) { + html.img([attribute.src("https://cataas.com/cat/" <> cat)]) + }), + ), ]) } ``` -- cgit v1.2.3