This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-10
Channels
- # admin-announcements (32)
- # announcements (4)
- # aws (25)
- # beginners (296)
- # boot (1)
- # cider (87)
- # clara (16)
- # cljs-dev (7)
- # cljsrn (41)
- # clojure (121)
- # clojure-art (26)
- # clojure-japan (4)
- # clojure-miami (190)
- # clojure-russia (168)
- # clojure-sg (3)
- # clojure-sweden (13)
- # clojurescript (138)
- # clojurex (7)
- # cursive (98)
- # data-science (2)
- # datomic (129)
- # devcards (10)
- # editors (5)
- # funcool (1)
- # hoplon (31)
- # jobs (1)
- # ldnclj (4)
- # lein-figwheel (3)
- # off-topic (2)
- # om (213)
- # onyx (33)
- # parinfer (7)
- # portland-or (1)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (27)
- # slack-help (3)
Just FYI, today I am gonna live code in re-frame at our regional functional programming meetup 😉. Hope everything will go fine
well I have very good experience with re-frame and live coding 😉. Month ago, I was teaching on my Uni, and live coded as well, without any bigger issues
Good luck, I bet people will be amazed watching state change without reloading the browser.
I just wrote a handler that takes paths (into app-db) and transitions values in those paths, i.e. assigns a value or updates it according to some spec.
Now I noticed that this adds some coupling between app db structure and my dispatched events (vs. everything is handled within the handler)
I wonder if someone has an opinion to offer or more generally what you're doing to not end up with 100s of super simplistic handlers just toggling or assigning values
@martinklepsch: something that i’ve been doing w/ subscriptions that i’m going to start doing w/ my super simple handlers is use naming conventions and just loop through a collection of keywords to do the handler registration
(def state-kws [:foo :bar :baz :quux])
(doseq [k state-kws]
;; a simple pass-through from the db
(rf/register-sub k (fn [db _] (reaction (k @db)))))
@martinklepsch: I really like the concept described here for doing that. https://skillsmatter.com/skillscasts/7227-clojurescript-architecting-for-scale
@martinklepsch: you could make a handler like :mutate-db
which gets passed a path (or part of a path) and a value. It’s a tradeoff between number of handlers, and complexity of handlers and app
martinklepsch: i have some similar handlers... feels a bit icky, but the alternatives seemed worse