herminiotorres

herminiotorres

Programming Phoenix LiveView: Typo

Hi! I know not the intentions behind this narrative when called, on page XI:

mount() |> handle_event() |> render()

but the correct flow, it’s:

mount() |> render()  |> handle_event() |> render()

On page XII, it’s missing the content about chapter 1.

Marked As Solved

SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

Thank you so much for helping by pointing these out! You’ll find most of the fixes applied in an upcoming Beta release. Not the next release, but probably the one after that :smiley:

Also Liked

froucoux

froucoux

On page 22 : Finally, we return a tuple in the shape that LiveView expects—{:ok, socket}

Shouldn’t it be: {:noreply, socket} ?

cro

cro

Thanks for the pointer. I had to manually update the dependency versions in mix.exs, mix hex.outdated gave me what I pasted below. After I did that and ran mix deps.update --all it cleared up.

$ mix hex.outdated
Dependency              Current  Latest  Update possible
ecto_sql                3.5.4    3.5.4
floki                   0.30.0   0.30.0
gettext                 0.18.2   0.18.2
jason                   1.2.2    1.2.2
phoenix                 1.5.8    1.5.8
phoenix_ecto            4.2.1    4.2.1
phoenix_html            2.14.3   2.14.3
phoenix_live_dashboard  0.2.0    0.4.0   No
phoenix_live_reload     1.3.0    1.3.0
phoenix_live_view       0.12.1   0.15.4  No
plug_cowboy             2.4.1    2.4.1
postgrex                0.15.8   0.15.8
telemetry_metrics       0.4.2    0.6.0   No
telemetry_poller        0.5.1    0.5.1
SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

Hi there! Thanks for you feedback and questions :slight_smile:

  • p.75, Ch 1, §“Handle Events”: “Finally, we return a tuple in the shape that LiveView expects—{:ok, socket}.” For handle_event I think the tuple has to be {:no_reply, socket} or {:reply, socket}?

You are correct! You’ll find this updated in the next Beta release :cupcake:

  • p.98, P 1 Ch 2, §“Reducers in Plug”: The second representation of the pipeline using pipe operators still has plug in the last three lines, but I think shouldn’t?

Yes I think this example will be more clear with the change you are suggesting. You’ll find it in the next release!

p.71, Ch 1, § “Render the Live View”: Just wondering, since the links you’re rendering go nowhere, if the semantics here aren’t better represented by <buttons> ? And similarly the <h2> tag could be replaced by an ordered list?

Great suggestions and I think if I was building a “real” game, cleaning up the code in that way would be the way to go. But the current approach will suffice for this example :slight_smile:

Popular Prag Prog topics Top

New
kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New

Latest in PragProg

View all threads ❯