This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-28
Channels
- # announcements (30)
- # architecture (9)
- # aws (2)
- # babashka (23)
- # beginners (55)
- # cider (22)
- # clj-kondo (40)
- # clojure (47)
- # clojure-europe (4)
- # clojure-france (2)
- # clojure-italy (17)
- # clojure-nl (16)
- # clojure-norway (1)
- # clojure-sanfrancisco (1)
- # clojure-seattle (1)
- # clojure-spec (12)
- # clojure-uk (34)
- # clojured (3)
- # clojurescript (15)
- # core-async (11)
- # cursive (19)
- # data-science (3)
- # emacs (7)
- # events (4)
- # figwheel-main (10)
- # fulcro (33)
- # graalvm (49)
- # graphql (11)
- # instaparse (1)
- # java (7)
- # kaocha (1)
- # leiningen (7)
- # malli (3)
- # meander (69)
- # pathom (9)
- # re-frame (4)
- # rum (2)
- # shadow-cljs (34)
- # spacemacs (9)
- # sql (29)
- # tree-sitter (1)
- # yada (3)
Hi all, clojure newb here. Been diving into re-frame and reagent and am wondering whether there is a way to auto-inject an interceptor for a re-frame event handler based on something like say the handler’s namespace.
The goal I have in mind is really just to abstract away having to sprinkle an interceptor all over a fairly large number of event handlers.
My first thought was to somehow jack-in to one of the two standard interceptors that the reg-event
functions prepend to the interceptor chain. But I don’t like the idea of having conditional logic run on each and every event handler call to determine whether they need to push an additional interceptor into the queue.
I guess then I would essentially have to write my own registration function? Any feedback/ideas or (even better) idiomatic ways to accomplish something like this would be much appreciated. Alternatively, it could be that just using my custom interceptor across a number of standard event registration declarations would end up being more maintainable anyway… :thinking_face:
Thanks all!
@adriel.j You are on the right track https://github.com/day8/re-frame/blob/master/docs/FAQs/GlobalInterceptors.md
ah! excellent. Thanks. very much looking forward to https://github.com/day8/re-frame/issues/570!