<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="274907" data-post-id="274907">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachallaun" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachallaun/120/29208_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachallaun
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Awesome!</p>
<p>I’d recommend <a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html#module-managing-state" rel="noopener nofollow ugc">this section</a> of the docs. Also, at the risk of going too far, I think you’re doing yourself a disservice by using Surface while you’re getting started with and familiar with LiveView. I think Surface is awesome, but especially with LiveView 0.18+, much of the gap has been closed, and it will be much easier to find solutions/understand what’s going on if you don’t have to look in two places.</p>
<p>For instance, I think the Surface automatically delegates <code>handle_event</code> to live components, e.g.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># When using Surface
use Surface.LiveComponent

def render(assigns) do
  ~F"""
  &lt;button :on-click="some_event"&gt;Button&lt;/button&gt;
  """
end

def handle_event("some_event", _, socket) do
  ...
end

# When using LiveView
use Phoenix.LiveComponent

def render(assigns) do
  ~H"""
  &lt;button phx-click="some_event" phx-target={@myself}&gt;Button&lt;/button&gt;
  """
end

def handle_event("some_event", _, socket) do
  ...
end
</code></pre>
<p>Notice that in the <code>Phoenix.LiveComponent</code> version, you have to explicitly target <code>@myself</code> for the event to go to the live component and not the parent live view. I believe Surface does that delegation automatically, but it obviously can’t delegate <code>send(self(), ...)</code> because it doesn’t have that level of control.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="274907" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/request-liveview-timer-example/53194/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-274907" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="274907"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="274910" data-post-id="274910">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="r4z4" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/r4z4/120/28415_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  r4z4
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t think you’re going too far.  It’s kind of funny I chose Surface because of React experience and some similarities I saw so I thought it might actually be EASIER to kinda bridge the gap, but shows what I know I guess.</p>
<p>Yeah being able to stick to one set of docs is always useful too <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20">  &amp; thanks for the link on that front.  Just glad I am finally unstuck … feels good.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="274910" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/request-liveview-timer-example/53194/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-274910" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="274910"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>