We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was inspired by the streaming mechanism from Elixir's liveview component
defmodule CounterComponent do use Phoenix.LiveComponent def render(assigns) do ~L""" <div> <h2>Counter: <%= @count %></h2> <button phx-click="increment">Increment</button> <button phx-click="decrement">Decrement</button> </div> """ end def mount(_session, socket) do {:ok, assign(socket, count: 0)} end def handle_event("increment", _, socket) do {:noreply, assign(socket, count: socket.assigns.count + 1)} end def handle_event("decrement", _, socket) do {:noreply, assign(socket, count: socket.assigns.count - 1)} end end
and this will be used like this
<%= live_component @socket, CounterComponent, id: "counter" %>
In my opinion, this is a bit complicated way of working as the user needs to worry about sockets all the time.
We want to create an interface where the developer doesn't need to worry a lot about interacting with the websocket.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was inspired by the streaming mechanism from Elixir's liveview component
and this will be used like this
In my opinion, this is a bit complicated way of working as the user needs to worry about sockets all the time.
We want to create an interface where the developer doesn't need to worry a lot about interacting with the websocket.
The text was updated successfully, but these errors were encountered: