diff options
Diffstat (limited to 'lib/test/examples')
-rw-r--r-- | lib/test/examples/components.gleam | 12 | ||||
-rw-r--r-- | lib/test/examples/counter.gleam | 8 | ||||
-rw-r--r-- | lib/test/examples/input.gleam | 8 | ||||
-rw-r--r-- | lib/test/examples/nested.gleam | 12 | ||||
-rw-r--r-- | lib/test/examples/svg.gleam | 8 |
5 files changed, 24 insertions, 24 deletions
diff --git a/lib/test/examples/components.gleam b/lib/test/examples/components.gleam index 722b796..ed2f7f3 100644 --- a/lib/test/examples/components.gleam +++ b/lib/test/examples/components.gleam @@ -21,7 +21,7 @@ pub fn main() { "custom-counter", counter_init, counter_update, - counter_render, + counter_view, map.from_list([ #( "count", @@ -36,13 +36,13 @@ pub fn main() { // A `simple` lustre application doesn't produce `Effect`s. These are best to // start with if you're just getting started with lustre or you know you don't // need the runtime to manage any side effects. - let app = lustre.simple(init, update, render) - let assert Ok(_) = lustre.start(app, "[data-lustre-app]") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "[data-lustre-app]", Nil) Nil } -fn init() { +fn init(_) { [] } @@ -53,7 +53,7 @@ fn update(history, msg) { } } -fn render(history) { +fn view(history) { let on_custom_click = { use _ <- event.on("custom-click") Some("click") @@ -90,7 +90,7 @@ fn counter_update(count, msg) { } } -fn counter_render(count) { +fn counter_view(count) { div( [], [ diff --git a/lib/test/examples/counter.gleam b/lib/test/examples/counter.gleam index 759ebdf..4faf00c 100644 --- a/lib/test/examples/counter.gleam +++ b/lib/test/examples/counter.gleam @@ -12,8 +12,8 @@ pub fn main() { // A `simple` lustre application doesn't produce `Effect`s. These are best to // start with if you're just getting started with lustre or you know you don't // need the runtime to manage any side effects. - let app = lustre.simple(init, update, render) - let assert Ok(_) = lustre.start(app, "[data-lustre-app]") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "[data-lustre-app]", Nil) } // MODEL ----------------------------------------------------------------------- @@ -21,7 +21,7 @@ pub fn main() { pub type Model = Int -pub fn init() -> Model { +pub fn init(_) -> Model { 0 } @@ -43,7 +43,7 @@ pub fn update(model: Model, msg: Msg) -> Model { // VIEW ------------------------------------------------------------------------ -pub fn render(model: Model) -> Element(Msg) { +pub fn view(model: Model) -> Element(Msg) { div( [], [ diff --git a/lib/test/examples/input.gleam b/lib/test/examples/input.gleam index d59c0c9..ff4d794 100644 --- a/lib/test/examples/input.gleam +++ b/lib/test/examples/input.gleam @@ -14,8 +14,8 @@ pub fn main() { // A `simple` lustre application doesn't produce `Effect`s. These are best to // start with if you're just getting started with lustre or you know you don't // need the runtime to manage any side effects. - let app = lustre.simple(init, update, render) - let assert Ok(_) = lustre.start(app, "[data-lustre-app]") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "[data-lustre-app]", Nil) Nil } @@ -26,7 +26,7 @@ type Model { Model(email: String, password: String, remember_me: Bool) } -fn init() -> Model { +fn init(_) -> Model { Model(email: "", password: "", remember_me: False) } @@ -56,7 +56,7 @@ fn update(model: Model, msg: Msg) -> Model { // RENDER ---------------------------------------------------------------------- -fn render(model: Model) -> Element(Msg) { +fn view(model: Model) -> Element(Msg) { div( [attribute.class("container")], [ diff --git a/lib/test/examples/nested.gleam b/lib/test/examples/nested.gleam index 47bb9d5..91c2da4 100644 --- a/lib/test/examples/nested.gleam +++ b/lib/test/examples/nested.gleam @@ -14,8 +14,8 @@ pub fn main() { // A `simple` lustre application doesn't produce `Effect`s. These are best to // start with if you're just getting started with lustre or you know you don't // need the runtime to manage any side effects. - let app = lustre.simple(init, update, render) - let assert Ok(_) = lustre.start(app, "[data-lustre-app]") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "[data-lustre-app]", Nil) Nil } @@ -25,10 +25,10 @@ pub fn main() { type Model = Map(Int, counter.Model) -fn init() -> Model { +fn init(_) -> Model { use counters, id <- list.fold(list.range(1, 10), map.new()) - map.insert(counters, id, counter.init()) + map.insert(counters, id, counter.init(Nil)) } // UPDATE ---------------------------------------------------------------------- @@ -45,10 +45,10 @@ fn update(model: Model, msg: Msg) -> Model { // RENDER ---------------------------------------------------------------------- -fn render(model: Model) -> Element(Msg) { +fn view(model: Model) -> Element(Msg) { let counters = { use rest, id, counter <- map.fold(model, []) - let el = element.map(counter.render(counter), pair.new(id, _)) + let el = element.map(counter.view(counter), pair.new(id, _)) [el, ..rest] } diff --git a/lib/test/examples/svg.gleam b/lib/test/examples/svg.gleam index c1cc5fb..e895f1a 100644 --- a/lib/test/examples/svg.gleam +++ b/lib/test/examples/svg.gleam @@ -14,8 +14,8 @@ pub fn main() { // A `simple` lustre application doesn't produce `Effect`s. These are best to // start with if you're just getting started with lustre or you know you don't // need the runtime to manage any side effects. - let app = lustre.simple(init, update, render) - let assert Ok(_) = lustre.start(app, "[data-lustre-app]") + let app = lustre.simple(init, update, view) + let assert Ok(_) = lustre.start(app, "[data-lustre-app]", Nil) } // MODEL ----------------------------------------------------------------------- @@ -23,7 +23,7 @@ pub fn main() { pub type Model = Int -pub fn init() -> Model { +pub fn init(_) -> Model { 0 } @@ -45,7 +45,7 @@ pub fn update(model: Model, msg: Msg) -> Model { // VIEW ------------------------------------------------------------------------ -pub fn render(model: Model) -> Element(Msg) { +pub fn view(model: Model) -> Element(Msg) { div( [], [ |