Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 23, 2023
1 parent 1949752 commit 322869d
Show file tree
Hide file tree
Showing 7 changed files with 1,300 additions and 1,299 deletions.
5 changes: 3 additions & 2 deletions FAQs/UseASubscriptionInAnEventHandler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1687,11 +1687,12 @@ <h2 id="the-root-problem">The Root Problem<a class="headerlink" href="#the-root-
</div>
<h3 id="dom-event-handlers">DOM event handlers<a class="headerlink" href="#dom-event-handlers" title="Permanent link">&para;</a></h3>
<p>Inner functions, such as DOM event handlers, don't count. Consider this component:</p>
<div class="codehilite"><pre><span></span><code><span class="p">[</span><span class="ss">:button</span> <span class="p">{</span><span class="ss">:on-click</span> <span class="o">#</span><span class="p">(</span><span class="nf">subscribe</span> <span class="p">[</span><span class="ss">:some</span> <span class="p">(</span><span class="nf">gensym</span><span class="p">)])}]</span>
<div class="codehilite"><pre><span></span><code><span class="p">(</span><span class="kd">defn </span><span class="nv">my-btn</span> <span class="p">[]</span>
<span class="p">[</span><span class="ss">:button</span> <span class="p">{</span><span class="ss">:on-click</span> <span class="o">#</span><span class="p">(</span><span class="nf">subscribe</span> <span class="p">[</span><span class="ss">:some</span> <span class="p">(</span><span class="nf">gensym</span><span class="p">)])}])</span>
</code></pre></div>


<p>Our <code>:on-click</code> function isn't actually called here. Instead, we've given the function to the browser, expecting it to get called later. The problem is, reagent and re-frame have no way to safely manage your subscription at that time. The result is a memory leak. If the browser calls your <code>:on-click</code> a thousand times, re-frame will "create" a thousand unique subscriptions, and there's no code in place to "dispose" them later.</p>
<p>Our <code>:on-click</code> function isn't actually called when the component renders. Instead, we've given the function to the browser, expecting it to get called later. The problem is, reagent and re-frame have no way to safely manage your subscription at that time. The result is a memory leak. If the browser calls your <code>:on-click</code> a thousand times, re-frame will "create" a thousand unique subscriptions, and there's no code in place to "dispose" them later.</p>
<h3 id="re-frame-event-handlers">Re-frame event handlers<a class="headerlink" href="#re-frame-event-handlers" title="Permanent link">&para;</a></h3>
<p>Re-frame event handlers don't count either. Re-frame calls your event handlers within its own loop, which runs in a totally separate context from reagent's render loop.</p>
<div class="codehilite"><pre><span></span><code><span class="p">(</span><span class="nf">re-frame.core/reg-event-db</span>
Expand Down
2 changes: 1 addition & 1 deletion Flows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ <h2 id="layering-flows">Layering flows<a class="headerlink" href="#layering-flow
<p>Under the hood, flows relate to each other in a depedency graph.
An input like <code>(rf/flow&lt;- ::kitchen-area)</code> creates a dependency.
That means re-frame will always run <code>::kitchen-area</code> first,
ensuring its output value is current before :main-room-ratio flow can use it.</p>
ensuring its output value is current before your <code>:main-room-ratio</code> flow can use it.</p>
<div class="admonition note">
<p class="admonition-title">Our dataflow model</p>
<p>Dataflow is often conceptualized as a graph.
Expand Down
2,456 changes: 1,228 additions & 1,228 deletions js/docs.js

Large diffs are not rendered by default.

Binary file modified re-frame-docs-app.tar.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

134 changes: 67 additions & 67 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,271 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>https://day8.github.io/re-frame/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/re-frame/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/a-loop/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/application-state/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/dominoes-30k/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/event-handling-infographic/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/subscriptions/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/dominoes-live/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/EffectfulHandlers/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Interceptors/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Effects/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Coeffects/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Flows/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/review-todomvc/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/correcting-a-wrong/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/flow-mechanics/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/start-coding/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/all-models-are-wrong/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/on-dynamics/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/data-oriented-design/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/interconnections/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/historical/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/flows-advanced-topics/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/on-stable-dom-handlers/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/browser-dynamics/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/reusable-components/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/App-Structure/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Loading-Initial-Data/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Talking-To-Servers/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Subscribing-To-External-Data/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Debugging/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Testing/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Performance-Problems/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Solve-the-CPU-hog-problem/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/Using-Stateful-JS-Components/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/The-re-frame-logo/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/Inspecting-app-db/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/BestPractice/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/LoadOnMount/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/DoINeedReFrame/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/FocusOnElement/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/GlobalInterceptors/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/laggy-input/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/When-Does-Dispatch-Happen/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/UseASubscriptionInAnEventHandler/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/Logging/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/Null-Dispatched-Events/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/Why-Clear-Sub-Cache/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/PollADatabaseEvery60/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/ViewsOnGlobalRegistration/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/Why-CLJC/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/DB_Normalisation/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/FAQs/FullStackReframe/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/api-intro/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/api-builtin-effects/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/api-re-frame.core/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/api-re-frame.alpha/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2023/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2022/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2021/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2020/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2019/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2018/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2017/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2016/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/releases/2015/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://day8.github.io/re-frame/External-Resources/</loc>
<lastmod>2023-11-22</lastmod>
<lastmod>2023-11-23</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 322869d

Please sign in to comment.