This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-20
Channels
- # bangalore-clj (1)
- # beginners (145)
- # boot (8)
- # braid-chat (2)
- # capetown (2)
- # cider (27)
- # cljs-dev (232)
- # cljsrn (30)
- # clojure (223)
- # clojure-boston (1)
- # clojure-dusseldorf (2)
- # clojure-greece (1)
- # clojure-italy (21)
- # clojure-russia (16)
- # clojure-sanfrancisco (13)
- # clojure-spec (33)
- # clojure-uk (56)
- # clojurescript (165)
- # core-async (16)
- # core-logic (5)
- # cursive (14)
- # data-science (2)
- # datavis (2)
- # datomic (49)
- # duct (15)
- # editors (5)
- # emacs (6)
- # fulcro (11)
- # graphql (11)
- # hoplon (8)
- # jobs (4)
- # jobs-discuss (82)
- # jobs-rus (7)
- # leiningen (4)
- # luminus (5)
- # off-topic (90)
- # om (7)
- # om-next (1)
- # parinfer (67)
- # pedestal (34)
- # portkey (46)
- # re-frame (12)
- # reagent (4)
- # reitit (3)
- # remote-jobs (1)
- # ring-swagger (8)
- # shadow-cljs (13)
- # spacemacs (18)
- # specter (6)
- # sql (5)
- # tools-deps (4)
- # unrepl (40)
- # yada (26)
also @lwhorton, you say it's top down, but I think it is bottom up. Go to the very bottom. The individual pieces of data and the operations on those data. Most people start somewhere in the middle, e.g., everything this current view needs.
true bottom-up, where you break it down as far as it can go, is what you're looking for
Is there a generally accepted convention for defining default-interceptors
for all fx/db handlers? for example, I always want trim-v on everything, and usually a spec validator too. normally I would wrap the re-frame lib into my own my-ns.re-frame
and redefine some fns in that namespace, but it seems kind of heavy-handed
The problem is that the interceptors are hardcoded in the functions:
- https://github.com/Day8/re-frame/blob/master/src/re_frame/core.cljc#L84
- https://github.com/Day8/re-frame/blob/master/src/re_frame/core.cljc#L101
It would be probably better, if there was some var default-interceptors
which would be used by these functions and could be overwritten by the app.
you could make your own reg-event-* function:
(defn reg-event-xtreme [id handler] (reg-event-db id (your-default-interceptor) handler))
but i see where applying interceptors system wide would be useful, like having certain ones in a debug environment
@lwhorton you could make your own re-frame handlers, or make a common def
for the middleware you want and apply it in each of your event handlers
@nenadalm @lwhorton https://github.com/Day8/re-frame/blob/master/docs/FAQs/GlobalInterceptors.md