This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-26
Channels
- # admin-announcements (1)
- # alda (44)
- # aws-lambda (6)
- # beginners (8)
- # boot (187)
- # capetown (5)
- # cider (25)
- # cljs-dev (24)
- # cljsrn (93)
- # clojure (45)
- # clojure-austin (9)
- # clojure-canada (2)
- # clojure-greece (1)
- # clojure-mexico (3)
- # clojure-poland (3)
- # clojure-russia (1)
- # clojure-spec (12)
- # clojure-uk (13)
- # clojurescript (86)
- # cursive (9)
- # datascript (3)
- # datomic (32)
- # defnpodcast (4)
- # devcards (23)
- # editors (3)
- # emacs (5)
- # hoplon (27)
- # immutant (3)
- # lein-figwheel (9)
- # leiningen (4)
- # luminus (10)
- # om (32)
- # onyx (2)
- # other-languages (1)
- # perun (1)
- # protorepl (8)
- # re-frame (13)
- # reagent (2)
- # remote-jobs (2)
- # ring (3)
- # spacemacs (4)
- # spirituality-ethics (3)
- # test-check (16)
- # untangled (65)
- # yada (50)
What I do, is for a certain panel, I'll mount just that panel into a devcard, and another panel underneath.
so for the login panel, it will fill fields via dispatch, try to submit via disaptch, etc.
basically a list of pure event vectors (like: [:update-signin :user "johnbo"]
) that might look like this:
{:signin-not-matching-pws
[[:reset-app-state]
[:update-signin :user "johnbo"]
[:update-signin :email ""]
[:update-signin :pw1 "johnbo"]
[:update-signin :pw2 "johnbo-notmatching"]
[:signin]]}
then a view simply has buttons with the vals of that structure, and when clicking the button, uses doseq and js/setTimeout to dispatch those events in that order.
@escherize: That sounds like a good approach, thanks! We had a bit more discussion in #C09GR9UJC as well if you are interested. I'm definitely going to experiment with the way you've been using devcards as I think it would be a really good fit for one of my older projects.
Hey, I have a beginner re-frame question: What’s the best way to preload an image I have access to before a component renders but not when my application starts? The ideas I've had are: * Use the js interop and create an image object as soon as I know the image URL which I could pass in to a my component at render time, but I don't know how to use an image object with Hiccups. * "Render" the component as soon as I know the image URL but set the style to "display=none". When I need to actually render the component update the display. Are there any better ones?
@zackbleach: I've ended up using the "display=none" route quite a few times for other situations and been pretty happy with it. It's much nicer doing it with re-frame than without, I've just set up a handler that fires when loading starts and another when it's ready to render. You might be able to adapt some of the ideas from https://github.com/Day8/re-frame/wiki/Subscribing-To-A-Database as there seems to be a bit of overlap there, but that might be a stretch.
@shaun-mahood: I've just set up a handler that fires when loading starts and another when it's ready to render
that’s exactly what I going to do (good to know I’m thinking about this in the right way). Thanks for the link!
@zackbleach: No problem, keep on asking if you've got more questions - it's a really friendly and helpful channel.
cheers 🙂