
joepstender
Programming Phoenix LiveView: errata and remarks Version B2.0
The generated iex result below should list products instead of product for the metadata. (page 67)
iex> product = %Product{}
%Pento.Catalog.Product{
__meta__: #Ecto.Schema.Metadata<:built, "product">,
…
}
The mount/3 function that is generated is different from the one used in the example, this might be confusing if you are familiar with the way pipes are used in Elixir. (Page 87)
def mount(_params, _session, socket) do
{:ok,
socket
|> assign(:greeting, "Welcome to Pento!") # add this line
|> assign(:products, list_products())}
end
Instead of
{:ok, assign(socket, :products, list_products())}
These few lines of code are a bit different from what we’ve seen before,… (Page 98)
Actually we have already seen this exact code 2 pages earlier, starting on page 96.
Suggestion: introduce the repeated code with: “Here’s the line of code that calls the modal component from the index template again:”
That means the component must implement a handle_event/3 function for the “close” event, which is does here: (Page 103)
Should be “… which it does here:”
Notice there’s an :id key, as well as a :component key that specifies the FormComponent (Page 106)
It is unclear what the :component_key is.
Marked As Solved

SophieDeBenedetto
Hello! Thank you so much for your feedback, we really appreciate it
Let’s go through it one thing as a time:
The generated iex result below should list products instead of product for the metadata. (page 67)
You are totally right! You’ll find this fixed in the next Beta release. Thanks for pointing it out
The mount/3 function that is generated is different from the one used in the example, this might be confusing if you are familiar with the way pipes are used in Elixir. (Page 87)
Good catch! In fact this code snippet does change the way the generated mount/3
function calls assign
in order to add the products to the socket. You’ll find this updated for clarity in the next Beta release.
Actually we have already seen this exact code 2 pages earlier, starting on page 96.
Suggestion: introduce the repeated code with: “Here’s the line of code that calls the modal component from the index template again :”
Yep you are right that we’ve shown you this code snippet already. I’ll add some language to clarify that in the next release.
Should be “… which it does here:”
Nice catch! Will fix in the next release.
It is unclear what the :component_key is.
The :component
key points to a value of the component that will be rendered in the modal–FormComponent
. I’ll add some language to clarify this but we also go into greater detail just a bit further on in the chapter.
Thanks again!
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /haskell
- /java
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /centos
- /ash
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim