Fork me on GitHub
#reagent
<
2021-12-02
>
sun-one18:12:42

for (reagent.reaction/ (code) I'm noticing that it's recomputing on any change to it's dependencies for example:

(def v (r/atom {:t 5}))

(def t (r/reaction
        (let [value @v]
         (println "reaction-triggered!!!" value)
         {:z (:t value)})))

(defn view []
  (let [
        tv         @t]
    (println tv)
    (reset! v {:t 5})
Will cause t to recompute even though the dependency is an identical (value v is getting reset to the identical value it started with). Is there an idiomatic way to get some form of memoization going here throughout reagent reactions where the reaction will only get evaluated when it's inputs are different?