mirror of https://github.com/status-im/reagent.git
wip - not working
This commit is contained in:
parent
829be2efa1
commit
1782ff1832
|
@ -245,9 +245,18 @@
|
|||
|
||||
IComputedImpl
|
||||
(-handle-change [this sender oldval newval]
|
||||
(when (and active? (not (identical? oldval newval)))
|
||||
(set! dirty? is-dirty)
|
||||
((or auto-run run) this)))
|
||||
(when active?
|
||||
(set! dirty? (max dirty?
|
||||
(if (identical? oldval newval)
|
||||
maybe-dirty is-dirty)))
|
||||
(if auto-run
|
||||
(when (> dirty? clean)
|
||||
((or auto-run run) this))
|
||||
(-notify-watches this state state)))
|
||||
;; (when (and active? (not (identical? oldval newval)))
|
||||
;; (set! dirty? is-dirty)
|
||||
;; ((or auto-run run) this))
|
||||
)
|
||||
|
||||
(-update-watching [this derefed]
|
||||
(doseq [w derefed]
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
(rv/running))
|
||||
(defn dispose [v] (rv/dispose! v))
|
||||
|
||||
(def testite 1)
|
||||
|
||||
(deftest basic-cursor
|
||||
(let [runs (running)
|
||||
start-base (rv/atom {:a {:b {:c 0}}})
|
||||
|
@ -85,7 +87,7 @@
|
|||
|
||||
|
||||
(deftest test-unsubscribe
|
||||
(dotimes [x 10]
|
||||
(dotimes [x testite]
|
||||
(let [runs (running)
|
||||
a-base (rv/atom {:test {:unsubscribe 0 :value 42}})
|
||||
a (r/cursor a-base [:test :unsubscribe])
|
||||
|
@ -171,7 +173,7 @@
|
|||
(is (= runs (running)))))
|
||||
|
||||
(deftest test-dispose
|
||||
(dotimes [x 10]
|
||||
(dotimes [x testite]
|
||||
(let [runs (running)
|
||||
a-base (rv/atom {:a 0 :b 0})
|
||||
a (r/cursor a-base [:a])
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
(set! rv/debug true)
|
||||
(rv/running))
|
||||
|
||||
(def testite 1)
|
||||
|
||||
(defn dispose [v]
|
||||
(rv/dispose! v))
|
||||
|
||||
|
@ -89,7 +91,7 @@
|
|||
|
||||
|
||||
(deftest test-unsubscribe
|
||||
(dotimes [x 10]
|
||||
(dotimes [x testite]
|
||||
(let [runs (running)
|
||||
a (rv/atom 0)
|
||||
a1 (reaction (inc @a))
|
||||
|
@ -166,7 +168,7 @@
|
|||
(is (= runs (running)))))
|
||||
|
||||
(deftest test-dispose
|
||||
(dotimes [x 10]
|
||||
(dotimes [x testite]
|
||||
(let [runs (running)
|
||||
a (rv/atom 0)
|
||||
disposed (rv/atom nil)
|
||||
|
|
Loading…
Reference in New Issue