Skip to content

Commit e4c793a

Browse files
authored
update readme
1 parent bb8e93e commit e4c793a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ pub fn main() {
138138
Now, inside `HEEX` we can render it using the `.lustre` component:
139139

140140
```elixir
141-
defmodule MyApp.MyLiveView do
142-
use MyApp, :live_view
141+
defmodule MyAppWeb.MyLiveView do
142+
use MyAppWeb, :live_view
143143

144144
import Lissome.Component
145145

@@ -252,7 +252,7 @@ type Msg {
252252
ServerReply(live_view.LiveViewPushResponse)
253253
}
254254
255-
pub fn init(flags, lv_hook: LiveViewHook) {
255+
pub fn init(flags, lv_hook: lissome.LiveViewHook) {
256256
let eff = live_view.handle_event(
257257
lv_hook: lv_hook,
258258
event: "send-name",
@@ -262,15 +262,15 @@ pub fn init(flags, lv_hook: LiveViewHook) {
262262
#(flags, eff)
263263
}
264264
265-
pub fn update(model, msg, lv_hook: LiveViewHook) {
265+
pub fn update(model, msg, lv_hook: lissome.LiveViewHook) {
266266
case msg {
267267
ServerUpdatedName(name) -> #(Model(..model, name:), effect.none())
268268
UserUpdatedEmail(email) -> {
269269
let eff = live_view.push_event(
270270
lv_hook: lv_hook,
271271
event: "update-email",
272272
payload: email,
273-
on_reply: Nothing
273+
on_reply: ServerReply
274274
)
275275
276276
#(Model(..model, email:), eff)
@@ -286,7 +286,7 @@ pub fn view(model) {
286286
//...
287287
}
288288
289-
pub fn main(hook: LiveViewHook) {
289+
pub fn main(hook: lissome.LiveViewHook) {
290290
let flags = Model("John", "jhon@gmail.com")
291291
let app = lissome.application(init, update, view, hook)
292292
let assert Ok(_) = lustre.start(app, "#app", flags)

0 commit comments

Comments
 (0)