This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (3)
- # architecture (5)
- # beginners (10)
- # boot (223)
- # cider (13)
- # cljsjs (2)
- # cljsrn (50)
- # clojure (208)
- # clojure-austin (16)
- # clojure-belgium (1)
- # clojure-india (1)
- # clojure-poland (13)
- # clojure-russia (130)
- # clojure-spec (27)
- # clojure-uk (144)
- # clojurescript (135)
- # css (2)
- # cursive (10)
- # datavis (1)
- # datomic (29)
- # dirac (9)
- # funcool (2)
- # hoplon (41)
- # jobs (3)
- # leiningen (6)
- # om (37)
- # onyx (20)
- # pedestal (1)
- # planck (1)
- # proton (4)
- # re-frame (45)
- # reagent (17)
- # rethinkdb (16)
- # ring-swagger (19)
- # schema (5)
- # specter (93)
- # sql (16)
- # test-check (33)
- # untangled (7)
@johanatan: any specific questions? I've built apps with css, sass and garden and I don't think it really matters from the point of view of re-frame.
how re-frame-y it is to put a reaction in the view instead of creating a subscription?
(defn my-component  (let [a (subscribe [:a]) b (subscribe [:b]) c (reaction (my-fun @a @b))] (..do stuff with c..)
if you’re not getting data from app-db, it should probably be in app-db, and then use a subscription 🙂
my issue is that I use that reaction only there, while my other subscriptions are used 2+ times
If a and b are both changed, you may get places where a is updated first which reruns c, then b is updated and reruns c again
I’m not 100% if this is one of those places, Mike Thompson would be able to say for sure
yep, there's a lambda with no parameters that returns hiccup, it's a form2 component
Just checked, a and b shouldn't change at the same time, so glitching is not an issue
So if you use a sub in 5 different places, only one reaction is created and run, and the reference is passed to all 5 callers
hi all, does anyone know a good way of writing tests for a re-frame subscription that relies on synchronous event dispatch to alter behaviour before assertions are made?
i like writing the test that way - it lets me know my events and subs are all wired up correctly
the problem is that when an event results in another event being dispatched i don't know how to wait for the second one to be completed before i make my assertion, and
dispatch-sync doesn't help in this instance because the nested dispatch doesn't honour it
This is the core of it: https://github.com/Day8/re-frame-test/blob/master/src/day8/re_frame/test.cljc#L29-L51
Concurrently, in that repo we are also trying to figure out how to run such tests on BOTH CLJS and CLJ. Which is proving a challenge
@mikethompson interesting thank you, i will probably cannibalise part of that for the meantime and keep an eye on progress. for what it's worth my first thought was to redef
dispatch-sync and see how far that got me as with that sort of test there's no browser render to yield to. also, i've found that with cljs async i can get tests working in chrome (local dev) that simply don't work in phantomjs (CI) but that is using a combo of
go blocks which is apparently a no-go on phantomjs
Another testing question - the schema being checked against app-db is supposed to represent the entire application state's schema or just the part being modified?
@shaun-mahood: oh, I was just wondering how to integrate into lein and figwheel for automatic compilation and watching. I ended up using stylus (standalone exe) and a Makefile.
(Works perfectly. Stylus compiles to CSS and then figwheel picks that up and hands to the browser).
@johanatan: Figwheel has a SASS watcher as well https://github.com/bhauman/lein-figwheel/wiki/SASS-watcher. If you're not all in on SASS, you should definitely try garden as well - not sure if it integrates with figwheel directly, but just running
lein garden auto worked perfectly with figwheel for me and it removes the dependency on ruby. I found SASS pretty limiting in terms of abstractions compared to garden, so even though I liked it much better than just css moving to garden made a big difference to the ease of working with stylesheets for me.
Oh yeah, I was mixing up compass (for SASS) with stylus. I've never used Stylus...
Hey guys, anyone using re-frame with heroku? This issue could use your help: https://github.com/Day8/re-frame-template/issues/32