Post
I have a question 😅 I built a silly quiz app for my daughter. When you open the quiz page, there‘s an error flash message and I don‘t understand why. Here‘s the code: github.com/HerrBertling... - can you by chance spot something? This all looks at least okay to me 🤷🏼♂️🫠
Assigning and reassigning attributes how you’re currently is not very idiomatic. You’ll want to either: 1) check the socket connection status in `mount/3` and branch the assignment logic depending on if the liveview is connected or disconnected (2/4)
0 reposts2 likes
3) use `assign_async/4` and adjust the rendered view to handle a loading state if `Quiz.get_questions/1` is slow to return data. All three options depend on how you want to build things out. For more context on the LiveView Lifecycle, check out the docs here: hexdocs.pm/phoenix_live... (4/4)