mirror of https://github.com/status-im/reagent.git
Add warning when derefing a changed wrap
This commit is contained in:
parent
6e0e9ed564
commit
2c7abcb710
|
@ -260,7 +260,7 @@
|
|||
|
||||
IDeref
|
||||
(-deref [this]
|
||||
(if-not (or auto-run *ratom-context*)
|
||||
(if-not (or auto-run (some? *ratom-context*))
|
||||
(do
|
||||
(when dirty?
|
||||
(let [oldstate state]
|
||||
|
@ -321,7 +321,12 @@
|
|||
IAtom
|
||||
|
||||
IDeref
|
||||
(-deref [this] state)
|
||||
(-deref [this]
|
||||
(when (dev?)
|
||||
(when (and changed (some? *ratom-context*))
|
||||
(log "warning: derefing stale wrap: "
|
||||
(pr-str this))))
|
||||
state)
|
||||
|
||||
IReset
|
||||
(-reset! [this newval]
|
||||
|
|
Loading…
Reference in New Issue