This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-11
Channels
- # beginners (57)
- # boot (9)
- # clara (9)
- # cljs-dev (12)
- # clojure (98)
- # clojure-boston (1)
- # clojure-dusseldorf (12)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-spec (41)
- # clojure-uk (86)
- # clojurescript (60)
- # code-art (2)
- # data-science (5)
- # datomic (5)
- # duct (1)
- # fulcro (14)
- # graphql (2)
- # lein-figwheel (4)
- # luminus (1)
- # midje (1)
- # off-topic (19)
- # om (10)
- # onyx (13)
- # pedestal (5)
- # portkey (59)
- # re-frame (31)
- # reagent (1)
- # ring (14)
- # ring-swagger (1)
- # rum (5)
- # shadow-cljs (90)
- # spacemacs (5)
- # specter (47)
- # sql (9)
- # uncomplicate (95)
- # vim (32)
I have been experimenting with the re-com reagent components and now I need a way to allow the user to upload a file and the components do not seem to support that option (input type="file")
@raymcdermott try over reagent http://reactiveclojure.blogspot.tw/2017/03/how-to-style-your-input-file-in-reagent.html
thanks @lovuikeng I will have a look
yogthos makes Luminus
, I'm sure you'll learn from there, @raymcdermott
what is the difference between these two?
(defn main-panel []
(let [some-message (re-frame/subscribe [:message])]
(fn []
[:div @some-message])))
and
(defn main-panel []
(let [some-message @(re-frame/subscribe [:message])]
[:div some-message]))
so basically returning a function
rather than hiccup
straight away?Have a look through the Reagent tutorials at the bottom of this page: https://github.com/Day8/re-frame/wiki#reagent-tutorials
@bravilogy ^^^^ But from a re-frame point of view those two are the same. But you really should read those tutorials.
got it. so in my case it doesn’t make much difference but if I had some initial setup (like an internal state for example), then the form-2 would make more sense so that I don’t do the initial setup over and over again on each re-render
@bravilogy "If you need to initialize something when the component is created, you use a Form-2 component", otherwise use Form-1 since you don't have any init data logic for it https://purelyfunctional.tv/guide/reagent/
@djtango I followed this: https://pupeno.com/2015/08/26/no-hashes-bidirectional-routing-in-re-frame-with-bidi-and-pushy/
@djtango I built on that for this little project of mine: https://github.com/manuel-uberti/boodle/blob/master/src/cljs/boodle/routes.cljs
@djtango here is one to go along with secretary
using re-frame-template +routes
http://www.multunus.com/blog/2016/02/noobs-walkthrough-re-frame-app/
the other day I saw that in re-frame
you can chain subscriptions and I can’t find those docs explaining how to do it
Ok I’ve added some more functionality to this 😄 https://frequent-scarecrow.surge.sh/ here’s the codebase if anyone’s interested: https://github.com/bravilogy/colours-game-clojure
@bravilogy that's neat, I couldn't handle more than a minute of that ha