This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-09
Channels
- # announcements (1)
- # architecture (20)
- # aws (22)
- # babashka (41)
- # beginners (191)
- # chlorine-clover (66)
- # cider (19)
- # clj-kondo (54)
- # cljs-dev (15)
- # cljsrn (78)
- # clojars (1)
- # clojure (148)
- # clojure-android (4)
- # clojure-europe (7)
- # clojure-gamedev (15)
- # clojure-germany (6)
- # clojure-losangeles (46)
- # clojure-nl (23)
- # clojure-survey (3)
- # clojure-uk (46)
- # clojurescript (24)
- # conjure (21)
- # cursive (21)
- # data-science (11)
- # datomic (5)
- # events (2)
- # fulcro (28)
- # garden (32)
- # joker (2)
- # kaocha (6)
- # lambdaisland (4)
- # mount (2)
- # off-topic (11)
- # pathom (10)
- # pedestal (13)
- # re-frame (7)
- # shadow-cljs (15)
- # spacemacs (21)
- # specmonstah (1)
- # wasm (1)
- # windows (1)
- # xtdb (37)
Is it possible to add interceptors to all registered events without having to go in and add the interceptor to each and every event one by one? I'm thinking of use-cases where you'd want to add some middleware-like behavior for all http-fx requests your application dishes out - wherein you'd have some interceptor you'd like all the events to go through (e.g. adding a required header to all requests)
Yes, it's an FAQ: https://github.com/day8/re-frame/blob/master/docs/FAQs/GlobalInterceptors.md
that doesn’t work if you want to add interceptors from events added from libraries?
being able to add global interceptors is good enough for me, atm - I'll make it work
thanks!
there is an atom in re-frame/registrar
in that holds all of the registered events, https://github.com/day8/re-frame/blob/69a3fcd411369fff65404e7d6a924ce1968e2dba/src/re_frame/registrar.cljc#L15 . you could muck with that, but it’s potentially a very bad idea ™️
I'll take a look, thanks