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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="grych" data-post="398" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>We can’t. Session cookie is http only.</p>
</blockquote>
</aside>
<p>Yeah if only we could grab that and the origin via the socket constructor…  &gt;.&gt;</p>
<p>You could always make your own socket wrapper class, hmm…</p>
<p>Looks awesome overall though!!!</p>
<aside class="quote no-group" data-username="elay1" data-post="399" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/elay1/48/21562_2.png" class="avatar"> elay1:</div>
<blockquote>
<p>** (RuntimeError) the algorithm :aes_gcm is not supported by your Erlang/OTP installation. Please make sure it was compiled with the correct OpenSSL/BoringSSL bindings</p>
</blockquote>
</aside>
<p>This has nothing to do with Drab and is purely a broken OTP installation, google can assist with that (as I don’t use a mac ^.^;).  <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"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="92425" data-batch-url="/posts/batch_likers">
                        0
                      </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/drab-remote-controlled-frontend-framework-for-phoenix/3277/403">Post #402</a>
	                </div>
	            </div>
              <div id="likers-container-92425" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="92425"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #402"></div>
  </section>
</div>
    <div class="postbit" id="92468" data-post-id="92468">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <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 class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="403" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Yeah if only we could grab that and the origin via the socket constructor… &gt;.&gt;</p>
</blockquote>
</aside>
<p>It is not a problem if I want to read the session cookie, I can always clone it in the plug. The issue is I can’t write it anyhow.<br>
Anyway, looks like session will remain read-only in Drab. But it could be good to have some store, session or whatever to exchange informations between controller and commander world.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="403" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>You could always make your own socket wrapper class, hmm…</p>
</blockquote>
</aside>
<p>Elaborate, please!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="92468" data-batch-url="/posts/batch_likers">
                        0
                      </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/drab-remote-controlled-frontend-framework-for-phoenix/3277/404">Post #403</a>
	                </div>
	            </div>
              <div id="likers-container-92468" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="92468"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #403"></div>
  </section>
</div>
    <div class="postbit" id="92527" data-post-id="92527">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="grych" data-post="404" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>Elaborate, please!</p>
</blockquote>
</aside>
<p>Well you know the transports used, like on the line:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">transport :websocket, Phoenix.Transports.WebSocket
</code></pre>
<p>The <code>Phoenix.Transports.WebSocket</code> part is just fulfilling a behaviour, it might be possible to make a module that just delegates back to that one but overrides a few key functions on it to perform the cookie work again (and don’t forget the origin check!), that would be a great standalone library actually…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="92527" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/405">Post #404</a>
	                </div>
	            </div>
              <div id="likers-container-92527" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="92527"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #404"></div>
  </section>
</div>
    <div class="postbit" id="97717" data-post-id="97717">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ahoy, <a class="mention" href="/u/overminddl1" rel="nofollow">@OvermindDL1</a>, I’ve just started adding Drab to Unpoly to handle some more interactivity to my search results page that I couldn’t achieve with Unpoly alone.</p>
<p>Things work peachy until Unpoly swaps out my search results page with a different set of search results. Elements that have been decorated with “drab-click” and “drab-change” no longer work! I’ve tried using shared controllers as you suggested, but to no avail…</p>
<p>What code you use to reinitialize Drab onto newly inserted content? Saw that you were the other kid on the block using the Drab + Unpoly combo, hoping you’ve run into this problem before!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97717" data-batch-url="/posts/batch_likers">
                        4
                      </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/drab-remote-controlled-frontend-framework-for-phoenix/3277/406">Post #405</a>
	                </div>
	            </div>
              <div id="likers-container-97717" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97717"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #405"></div>
  </section>
</div>
    <div class="postbit" id="97761" data-post-id="97761">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="makeitrein" data-post="406" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/makeitrein/48/11686_2.png" class="avatar"> makeitrein:</div>
<blockquote>
<p>Things work peachy until Unpoly swaps out my search results page with a different set of search results. Elements that have been decorated with “drab-click” and “drab-change” no longer work! I’ve tried using shared controllers as you suggested, but to no avail…</p>
</blockquote>
</aside>
<p>You have to actually setup an Unpoly Router to ‘decorate’ the elements with the Drab javascript library again.  I’ve been meaning to pull mine out into a Drab addon (DrabUnpoly?) but it’s so tied in with the rest of my stuff and I’ve been so out of time that I’ve not been able to yet.  ^.^</p>
<p><a class="mention" href="/u/grych" rel="nofollow">@grych</a> Can help with the proper calls to reinitialize elements with Drab, just add those to an Unpoly router on load/unload and so forth.  <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"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97761" data-batch-url="/posts/batch_likers">
                        3
                      </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/drab-remote-controlled-frontend-framework-for-phoenix/3277/407">Post #406</a>
	                </div>
	            </div>
              <div id="likers-container-97761" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97761"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #406"></div>
  </section>
</div>
    <div class="postbit" id="97809" data-post-id="97809">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <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 class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="407" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Can help with the proper calls to reinitialize elements with Drab</p>
</blockquote>
</aside>
<p>There is a function <code>Drab.enable_drab_on(element)</code> which reinitializes Drabbed elements. See <a href="https://hexdocs.pm/drab/Drab.Client.html#module-drab-enable_drab_on-selector_or_node" class="inline-onebox" rel="noopener nofollow ugc">Drab.Client – drab v0.10.5</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97809" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/408">Post #407</a>
	                </div>
	            </div>
              <div id="likers-container-97809" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97809"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #407"></div>
  </section>
</div>
    <div class="postbit" id="97813" data-post-id="97813">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><code>up.compiler("#up-results", function() { Drab.enable_drab_on("#up-results") });</code> does the trick! Thx for the heads up and thx for open-sourcing Drab.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97813" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/409">Post #408</a>
	                </div>
	            </div>
              <div id="likers-container-97813" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97813"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #408"></div>
  </section>
</div>
    <div class="postbit" id="98001" data-post-id="98001">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="grych" data-post="408" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>There is a function <code>Drab.enable_drab_on(element)</code> which reinitializes Drabbed elements. See <a href="https://hexdocs.pm/drab/Drab.Client.html#module-drab-enable_drab_on-selector_or_node" rel="noopener nofollow ugc">https://hexdocs.pm/drab/Drab.Client.html#module-drab-enable_drab_on-selector_or_node </a></p>
</blockquote>
</aside>
<p>That was it!  Thanks much!  <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"></p>
<aside class="quote no-group" data-username="makeitrein" data-post="409" data-topic="3277" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/makeitrein/48/11686_2.png" class="avatar"> makeitrein:</div>
<blockquote>
<p><code>up.compiler("#up-results", function() { Drab.enable_drab_on("#up-results") });</code> does the trick! Thx for the heads up and thx for open-sourcing Drab.</p>
</blockquote>
</aside>
<p>There’s actually a compiler/router callback for handling ‘all elements that have been loaded via some kind of ajax call’ that is a convenient place to put such things in.  <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"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="98001" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/410">Post #409</a>
	                </div>
	            </div>
              <div id="likers-container-98001" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="98001"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #409"></div>
  </section>
</div>
    <div class="postbit" id="98240" data-post-id="98240">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="doogs" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  doogs
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey, I have been trying Drab out.<br>
I have a question about Broadcasting.</p>
<p>I have a genserver doing some stuff, and I would like Drab to update the assigns on a page when an event happens in the GenServer. For instance, when data is added to the genserver I want to push this to the live view using Drab.<br>
I read that it you dont pass the socket to the broadcast function then you need to pass in all assigns and view etc. But I wont really have the data for all assigns, so this doesnt seem like a possibility?</p>
<p>So my question is, what would be the best way to do this?<br>
Can I store the socket in a Drab store and retrive it in the genserver?<br>
Is there some way to get the socket info into other parts of my application without user interaction on the frontend?</p>
<p>Lastly, if I wanted to trigger a drab call from a JS function, like using a timeout to “ping” the Drab event handlers, how would I do that?</p>
<p>Sorry for all the questions, just trying to understand how to use Drab for server side events, not when a users has to interact with the page.</p>
<p>thanks alot</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="98240" data-batch-url="/posts/batch_likers">
                        0
                      </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/drab-remote-controlled-frontend-framework-for-phoenix/3277/411">Post #410</a>
	                </div>
	            </div>
              <div id="likers-container-98240" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="98240"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #410"></div>
  </section>
</div>
    <div class="postbit" id="98249" data-post-id="98249">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <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 class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="doogs" data-post="411" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/9de0a6/48.png" class="avatar"> doogs:</div>
<blockquote>
<p>I read that it you dont pass the socket to the broadcast function then you need to pass in all assigns and view etc. But I wont really have the data for all assigns, so this doesnt seem like a possibility?</p>
</blockquote>
</aside>
<p>Yes, you can give a topic to any broadcasting function instead of the socket.<br>
And yes, to broadcast <code>poke</code> (update of an assign) you need to give <em>all assigns values</em>. The reason is very simple: every browser may have different state at the same time. Broadcasting poke overwrites all the states to the given one.<br>
This is why I should not do a broadcasting version of <code>poke</code>. I recommend you to use traditional DOM updates (from Drab.Element for example) when broadcasting.<br>
See <a href="https://github.com/grych/drab/issues/60" class="inline-onebox" rel="noopener nofollow ugc">Allow to broadcast using poke / peek · Issue #60 · grych/drab · GitHub</a> for more.</p>
<aside class="quote no-group" data-username="doogs" data-post="411" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/9de0a6/48.png" class="avatar"> doogs:</div>
<blockquote>
<p>Can I store the socket in a Drab store and retrive it in the genserver?</p>
</blockquote>
</aside>
<p>It is not practical. The socket is just a struct, where the most important information is a PID of the channel process (and in case you are using Drab, the PID of the Drab process).<br>
When browser is disconnected, channel and drab process dies.<br>
There is an idea to replace socket with something more abstract, which identifies a browser. In this case you might send an update to the browser which is disconnected. See <a href="https://forum.elixirforum.com/t/elixirconf-us-2018-closing-keynote-chris-mccord/16445/76" class="inline-onebox" rel="nofollow">54) ElixirConf US 2018 – Closing Keynote – Chris McCord - #76 by grych</a></p>
<aside class="quote no-group" data-username="doogs" data-post="411" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/d/9de0a6/48.png" class="avatar"> doogs:</div>
<blockquote>
<p>Lastly, if I wanted to trigger a drab call from a JS function, like using a timeout to “ping” the Drab event handlers, how would I do that?</p>
</blockquote>
</aside>
<p>Easy, just use <code>Drab.exec_elixir()</code> method from JS. See docs for Drab.Client.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="98249" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/412">Post #411</a>
	                </div>
	            </div>
              <div id="likers-container-98249" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="98249"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #411"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/3277/load_more?page=42">Load more posts (78 remaining)</a>
</div></template></turbo-stream>