mirror of https://github.com/status-im/reagent.git
Make reaction with error always throw on deref
This commit is contained in:
parent
d776b88113
commit
995acb6c34
|
@ -391,9 +391,10 @@
|
|||
(doseq [w (s/difference old new)]
|
||||
(-remove-watch w this))))
|
||||
|
||||
(_try-run [this other]
|
||||
(_try-run [this]
|
||||
(when (and dirty? (some? watching))
|
||||
(try
|
||||
(set! caught nil)
|
||||
(._run this)
|
||||
(catch :default e
|
||||
(set! state e)
|
||||
|
@ -431,7 +432,6 @@
|
|||
IDeref
|
||||
(-deref [this]
|
||||
(when-some [e caught]
|
||||
(set! caught nil)
|
||||
(throw e))
|
||||
(let [non-reactive (nil? *ratom-context*)]
|
||||
(when non-reactive
|
||||
|
|
|
@ -365,6 +365,7 @@
|
|||
(swap! state inc)
|
||||
(rv/flush!))))
|
||||
(is (= @count 2))
|
||||
(is (thrown? :default @ref))
|
||||
(swap! state inc)
|
||||
(rv/flush!)
|
||||
(is (= @count 3))
|
||||
|
|
Loading…
Reference in New Issue