This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-11
Channels
- # admin-announcements (1)
- # aws (2)
- # beginners (32)
- # boot (147)
- # capetown (1)
- # cider (11)
- # cljs-dev (45)
- # cljsrn (57)
- # clojure (187)
- # clojure-russia (5)
- # clojure-spec (97)
- # clojure-uk (33)
- # clojurescript (33)
- # cloverage (17)
- # clr (4)
- # conf-proposals (93)
- # core-async (6)
- # cursive (9)
- # data-science (1)
- # datomic (24)
- # defnpodcast (1)
- # devcards (3)
- # emacs (3)
- # hoplon (95)
- # jobs (1)
- # off-topic (7)
- # om (97)
- # onyx (32)
- # overtone (1)
- # parinfer (4)
- # pedestal (1)
- # proton (1)
- # protorepl (13)
- # re-frame (4)
- # reagent (10)
- # specter (14)
- # untangled (40)
Clearly I’m doing something wrong, but reaction
doesn’t seem to be working correctly for me.
The wrapped computation ends up much too eager to re-run.
If I write something like
(def example
(reaction
(let [name @tile-width]
(log name))))
then the log gets called every time I deref example
instead of every time tile-width
changes.An r/track
also gets called every time I deref it, but r/track!
works like I expect it to. For example
(defn example-fn! [] (log @tile-width))
(def example! (r/track! example-fn!))
(defn example-fn [] (log @tile-width))
(def example (r/track example-fn))
is anyone familiar with using cljsjs to pull in react-with-addons? I’m for some reason always getting react.inc.js instead of with-addons.inc.js, despite a boot file as thus:
[reagent "0.6.0-alpha" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
,,,[cljsjs/react-with-addons "15.1.0-0"]
,,,[cljsjs/react-dom "15.1.0-0"]
,,,[cljsjs/react-dom-server "15.1.0-0"]
those exclusions look correct to me, though? if I look at the reagent build process, it seems to require r-dom and r-dom/server via cljsjs packages but then provide its own react from a webpack build:
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[cljsjs/react-dom "15.2.1-0"]
[cljsjs/react-dom-server "15.2.1-0”]]
…
:webpack {:cljsbuild
{:builds {:client
{:compiler
{:foreign-libs
[{:file "target/webpack/bundle.js"
:file-min "target/webpack/bundle.min.js"
:provides ["cljsjs.react.dom"
"cljsjs.react.dom.server"
"cljsjs.react"]
:requires []}]}}}}}
yet no matter what I do or which exclusions I list, I’m always getting react.inc.js not react-with-dom.inc.js?
Does anyone have any experience with using css animations and Reagent? I've got an element reacting to a r/atom called transforming?
thusly: :transform (if @transforming? "scale(1,0)" "none")
, and a different element changing the value of transforming?
like this:
:on-change (fn [check-node] (let [flip-transforming? #(swap! transforming? not)
toggled-check (get-checked check-node)]
(flip-transforming?)
(reset! checkbox-state toggled-check)))
However, the reset!
also causes a visual change to the same element that subscribes to the value of transforming?
, and (I'm guessing) since flip-transforming?
and the reset!
occur right after one another and within the same "tick", the scale(1,0)
never occurs.I've tested with the reset
commented out, and then, the animation appears correct.
How can I ensure that Reagent "waits" for css animations to finish?