<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged watcher</title>
<link>https://ask.clojure.org/index.php/tag/watcher</link>
<description></description>
<item>
<title>Should I care about removing watcher after a component did unmount?</title>
<link>https://ask.clojure.org/index.php/8631/should-care-about-removing-watcher-after-component-unmount</link>
<description>&lt;p&gt;Let's say I have following component with a local state and some watching logic:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn some-component []
  (r/with-let [local-state (r/atom {...})
               _ (add-watch local-state :on-change handle-change)]
    [:div ...]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should I care about removing the watcher (if yes, what's a best way to do that), or it will happen automatically when the component does unmount.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8631/should-care-about-removing-watcher-after-component-unmount</guid>
<pubDate>Sat, 21 Sep 2019 06:39:39 +0000</pubDate>
</item>
</channel>
</rss>