This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-07
Channels
- # admin-announcements (69)
- # alda (8)
- # beginners (6)
- # boot (182)
- # cider (10)
- # cljs-dev (24)
- # cljsrn (17)
- # clojars (70)
- # clojure (142)
- # clojure-brasil (5)
- # clojure-czech (1)
- # clojure-poland (4)
- # clojure-russia (96)
- # clojurescript (115)
- # community-development (37)
- # component (6)
- # cursive (11)
- # datomic (32)
- # events (4)
- # funcool (6)
- # hoplon (17)
- # ldnclj (10)
- # lein-figwheel (24)
- # mount (12)
- # om (141)
- # onyx (7)
- # parinfer (48)
- # re-frame (24)
- # reagent (31)
inside (re-frame/register-sub) is it ok to use (subscribe [:blahblah]) to link one subscription to another?
actually, just answered my own question by looking at code in re-frame-stiching-together repo
re-frame is so elegant. I could read the entire source in about 30 minutes, understanding how everything works behind the curtains.
comments are a big plus, helped a lot.
also learned some tricks, like lazily using multiple atoms to simplify implementation (https://github.com/Day8/re-frame/blob/master/src/re_frame/undo.cljs#L27-L31)
thanks 😄
I'll start using re-frame at a work project
re-frame is pretty fantastic and i've really enjoyed learning it thus far! just a quick best practices question: is it better to end a handler function by calling (dispatch [:some-second-event]) which in turn invokes a second handler, or should a single handler attempt to mutate app-db as much as possible in one go? i'm a bit worried that long chains of dispatches will become hard to keep track of when an application reaches a certain size, yet i see the value in small, testable, handlers that do their specific job and then dispatch to another event.
@hugobessaa: @rodeorockstar it is very nice to get such positive feedback. Thanks.
@rodeorockstar: you shouldn't think of dispatch
as acting like a function call. It really should be used to represent a genuine event
So what you probably want to do is to factor out the functions you want to call in the service of event handlers, and then simply call them from within the event handler
BTW, everyone .... when writing complicated event handlers you might find synthread useful
(But only useful if your event handers really are quite complicated, and most are not)
one of the most useful things to come out of that video, for me, is the built-in as->
macro that I just used for the first time ever. Clojure(Script) never gets boring.
My biggest issue with things like as->
are that they are so hard to google for
Then I remember http://conj.io/ and can finally find it
good point. I find http://clojuredocs.org/ very useful for things like that