This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-07
Channels
- # admin-announcements (19)
- # announcements (1)
- # beginners (14)
- # boot (244)
- # cider (2)
- # clojure (23)
- # clojure-dev (23)
- # clojure-poland (55)
- # clojure-russia (118)
- # clojure-uk (4)
- # clojurescript (143)
- # core-async (31)
- # core-logic (1)
- # cursive (30)
- # datascript (2)
- # datomic (3)
- # emacs (7)
- # hoplon (40)
- # ldnclj (8)
- # off-topic (2)
- # om (64)
- # reagent (10)
- # ring (1)
- # yada (71)
@mikethompson: thanks! still working on improving my knowledge of the library and css3. As I am using re-com, hopefully contribute some of what I have learnt back into that library.
@rohit I keeping wishing we had more in the way of animations / transitions, so I'm keen to see where you get to with this.
In a previous life, we used Flex (Flash) and oh wow did we have a lot to play with there. I love the React way, but I do miss access to all the cool kids animation toys
i can see that. i think many people are now trying to address this issue. Twitter also release their library for addressing this issue in react: https://fabric.io/blog/introducing-the-velocityreact-library
From the blogpost: That being said, React and animation don’t actually play well together at first. There’s an impedance mis-match: React’s power stems from abstracting away the state transitions in your UIs (it does them quickly and correctly, enabling the declarative paradigm we’ve come to love), while animations live entirely within those state transitions
I'll certainly be following progress with interest
Hey guys.
I have a question regarding testing the :on-click
action.
For example:
(deftest click-test
(when browser?
(let [component (fn [] [:div {:class "someclass"
:on-click #(println "something")}])]
(with-mounted-component (component)
(fn [c div]
(let [d (.querySelector div ".someclass")]
;; :on-click println never fires
(.trigger (js/jQuery d) "click")))))))
I borrowed the with-mounted-component
part from Reagent tests:
https://slack-redir.net/link?url=https%3A%2F%2Fgithub.com%2Freagent-project%2Freagent%2Fblob%2Fmaster%2Ftest%2Freagenttest%2Ftestreagent.cljs&v=3
In the example, :on-click
never fires (testing with phantomjs). How can I test this kind of thing?To make things more interesting, this actually works:
(deftest click-checkbox-test
(when browser?
(let [component (fn [] [:input {:type :checkbox
:class "someclass"
:on-click #(println "something")}])]
(with-mounted-component (component)
(fn [c div]
(let [d (.querySelector div "input")]
;; :on-click is fired
(.trigger (js/jQuery d) "click")))))))