Updates on broadcast #52
Unanswered
CosteaPaul
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
@CosteaPaul No, it's all good! Everything works on my machine with your example, I will record a short video showcasing what are my results. Your code is not storing anywhere a "starting value" of a counter, so when a new user comes to the page he always starts with PS. There's a small bug in |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to both LiveView and Elixir, so there's a good chance i'm mostly confused, though i'm hoping this is not a stupid question.
Using the simple example given in the README, i tried to "share" the counter across all users. What ends up happening is really patchy updating. Sometimes the counter goes up in the session where i'm incrementing, sometimes in a different session and everything runs out of sync.
At first i though it's just me doing something stupid with the broadcasting or the handling of the broadcast. But, if i change the render to this:
and just add a vanilla div with the count in it, the updating of this looks like what i would expect it to look.
For the record, the full live_view looks like this:
Am i missing something fundamental here?
Beta Was this translation helpful? Give feedback.
All reactions