dwyl / dwyl/phoenix-liveview-counter-tutorial
Feedback on tutorial (from a beginner's perspective)
- Dominant language
- Elixir
- Stars
- 421
- Forks
- 42
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 9
Description
Total elixir newbie here (so my ignorance is pretty high, but maybe this is a useful perspective).
> Invoking CounterWeb.Endpoint.broadcast_from sends a message from the current process self() on the @topic, the key is "inc" and the value is the new_state.assigns Map.
I think for people coming from other languages/frameworks it's a bit confusing to mention that the key is `"inc"`. I don't see that key pop up anywhere else after that, or see how the `"inc"` value is relevant. It looks like the new state of `:val` is already set and sent to the topic. Is it going to call `handle_event("inc", ...)` again? It doesn't look like it, it seems like `handle_info(...)` is going to update `assigns` for all the connected clients.
To put the question another way, why should I pass `"inc"` instead of `"foo"`?
Everything else is clear, but that's the one bit that doesn't make sense.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the tutorial passage describing CounterWeb.Endpoint.broadcast_from and read the surrounding LiveView broadcast and handle_info explanation. Clarify why the "inc" key is used, or state whether it is arbitrary, so a beginner can understand the message flow; the issue does not name a file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100