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
|
IComputedImpl
|
||||||
(-handle-change [this sender oldval newval]
|
(-handle-change [this sender oldval newval]
|
||||||
(when (and active? (not (identical? oldval newval)))
|
(when active?
|
||||||
(set! dirty? is-dirty)
|
(set! dirty? (max dirty?
|
||||||
((or auto-run run) this)))
|
(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]
|
(-update-watching [this derefed]
|
||||||
(doseq [w derefed]
|
(doseq [w derefed]
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
(rv/running))
|
(rv/running))
|
||||||
(defn dispose [v] (rv/dispose! v))
|
(defn dispose [v] (rv/dispose! v))
|
||||||
|
|
||||||
|
(def testite 1)
|
||||||
|
|
||||||
(deftest basic-cursor
|
(deftest basic-cursor
|
||||||
(let [runs (running)
|
(let [runs (running)
|
||||||
start-base (rv/atom {:a {:b {:c 0}}})
|
start-base (rv/atom {:a {:b {:c 0}}})
|
||||||
|
@ -85,7 +87,7 @@
|
||||||
|
|
||||||
|
|
||||||
(deftest test-unsubscribe
|
(deftest test-unsubscribe
|
||||||
(dotimes [x 10]
|
(dotimes [x testite]
|
||||||
(let [runs (running)
|
(let [runs (running)
|
||||||
a-base (rv/atom {:test {:unsubscribe 0 :value 42}})
|
a-base (rv/atom {:test {:unsubscribe 0 :value 42}})
|
||||||
a (r/cursor a-base [:test :unsubscribe])
|
a (r/cursor a-base [:test :unsubscribe])
|
||||||
|
@ -171,7 +173,7 @@
|
||||||
(is (= runs (running)))))
|
(is (= runs (running)))))
|
||||||
|
|
||||||
(deftest test-dispose
|
(deftest test-dispose
|
||||||
(dotimes [x 10]
|
(dotimes [x testite]
|
||||||
(let [runs (running)
|
(let [runs (running)
|
||||||
a-base (rv/atom {:a 0 :b 0})
|
a-base (rv/atom {:a 0 :b 0})
|
||||||
a (r/cursor a-base [:a])
|
a (r/cursor a-base [:a])
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
(set! rv/debug true)
|
(set! rv/debug true)
|
||||||
(rv/running))
|
(rv/running))
|
||||||
|
|
||||||
|
(def testite 1)
|
||||||
|
|
||||||
(defn dispose [v]
|
(defn dispose [v]
|
||||||
(rv/dispose! v))
|
(rv/dispose! v))
|
||||||
|
|
||||||
|
@ -89,7 +91,7 @@
|
||||||
|
|
||||||
|
|
||||||
(deftest test-unsubscribe
|
(deftest test-unsubscribe
|
||||||
(dotimes [x 10]
|
(dotimes [x testite]
|
||||||
(let [runs (running)
|
(let [runs (running)
|
||||||
a (rv/atom 0)
|
a (rv/atom 0)
|
||||||
a1 (reaction (inc @a))
|
a1 (reaction (inc @a))
|
||||||
|
@ -166,7 +168,7 @@
|
||||||
(is (= runs (running)))))
|
(is (= runs (running)))))
|
||||||
|
|
||||||
(deftest test-dispose
|
(deftest test-dispose
|
||||||
(dotimes [x 10]
|
(dotimes [x testite]
|
||||||
(let [runs (running)
|
(let [runs (running)
|
||||||
a (rv/atom 0)
|
a (rv/atom 0)
|
||||||
disposed (rv/atom nil)
|
disposed (rv/atom nil)
|
||||||
|
|
Loading…
Reference in New Issue