local experiments

This commit is contained in:
Robin Nagpal 2018-07-30 15:35:28 -04:00
parent 8febef26c0
commit 71047c2dc5
2 changed files with 13 additions and 2 deletions

View File

@ -23,7 +23,7 @@
:exclude clojure.string
:source-paths ["src"]}
:profiles {:dev {:dependencies [[org.clojure/clojurescript "1.10.238"]
#_#_:profiles {:dev {:dependencies [[org.clojure/clojurescript "1.10.238"]
[figwheel "0.5.16"]
[doo "0.1.10"]
[com.google.javascript/closure-compiler-unshaded "v20180319"]

View File

@ -337,7 +337,15 @@
(defn- handle-reaction-change [this sender old new]
(._handle-change this sender old new))
;; Fields of a Reaction javascript object
;; - auto_run
;; - captured
;; - caught
;; - f
;; - ratomGeneration
;; - state
;; - watches
;; - watching
(deftype Reaction [f ^:mutable state ^:mutable ^boolean dirty? ^boolean nocache?
^:mutable watching ^:mutable watches ^:mutable auto-run
^:mutable caught]
@ -498,8 +506,11 @@
(def ^:private temp-reaction (make-reaction nil))
(js/console.log "temp-reaction" temp-reaction)
(defn run-in-reaction [f obj key run opts]
(js/console.log "run-in-reaction" temp-reaction)
(let [r temp-reaction
res (deref-capture f r)]
(when-not (nil? (.-watching r))