mirror of https://github.com/status-im/reagent.git
Fix cljsRatom
This commit is contained in:
parent
14256cd487
commit
633122e8ee
|
@ -137,9 +137,10 @@
|
||||||
(def static-fns
|
(def static-fns
|
||||||
{:render
|
{:render
|
||||||
(fn render []
|
(fn render []
|
||||||
|
;; TODO: Use static property for cljsRatom
|
||||||
(this-as c (if util/*non-reactive*
|
(this-as c (if util/*non-reactive*
|
||||||
(do-render c)
|
(do-render c)
|
||||||
(let [rat (.-cljsRatom c)]
|
(let [rat (gobj/get c "cljsRatom")]
|
||||||
(batch/mark-rendered c)
|
(batch/mark-rendered c)
|
||||||
(if (nil? rat)
|
(if (nil? rat)
|
||||||
(ratom/run-in-reaction #(do-render c) c "cljsRatom"
|
(ratom/run-in-reaction #(do-render c) c "cljsRatom"
|
||||||
|
@ -195,8 +196,7 @@
|
||||||
:componentWillUnmount
|
:componentWillUnmount
|
||||||
(fn componentWillUnmount []
|
(fn componentWillUnmount []
|
||||||
(this-as c
|
(this-as c
|
||||||
(some-> (.-cljsRatom c)
|
(some-> (gobj/get c "cljsRatom") ratom/dispose!)
|
||||||
ratom/dispose!)
|
|
||||||
(batch/mark-rendered c)
|
(batch/mark-rendered c)
|
||||||
(when-not (nil? f)
|
(when-not (nil? f)
|
||||||
(.call f c c))))
|
(.call f c c))))
|
||||||
|
|
Loading…
Reference in New Issue