This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-16
Channels
- # beginners (115)
- # boot (13)
- # boot-dev (13)
- # chestnut (1)
- # cider (1)
- # clara (10)
- # cljs-dev (21)
- # cljsjs (1)
- # cljsrn (2)
- # clojure (120)
- # clojure-dusseldorf (2)
- # clojure-greece (13)
- # clojure-ireland (1)
- # clojure-italy (3)
- # clojure-nlp (3)
- # clojure-russia (2)
- # clojure-spec (13)
- # clojure-uk (82)
- # clojured (5)
- # clojurescript (47)
- # core-async (2)
- # core-logic (8)
- # cursive (45)
- # datomic (2)
- # editors (1)
- # emacs (39)
- # fulcro (166)
- # graphql (1)
- # hoplon (16)
- # keechma (5)
- # off-topic (202)
- # perun (4)
- # protorepl (7)
- # re-frame (28)
- # reagent (13)
- # ring (27)
- # ring-swagger (16)
- # rum (1)
- # shadow-cljs (25)
- # spacemacs (20)
- # sql (141)
- # yada (4)
Is there any example of modifying interceptors queue inside a interceptor?(filtering in my case)
I am interested in dispatching a re-frame event from native code (Android). Are there any resources that I can take a look at? I found this mentioned (https://clojurians-log.clojureverse.org/re-frame/2017-11-02.html) but was wondering if there were any resources…
Out of curiosity, why are event handlers not stored in the registrar (`kind->id->handler`) in the same manner as all the other handler types (i.e. :fx
, :cofx
, and :sub
)? Event handlers are stored as a list of interceptors instead of just a function, like everything else.
@kenny the list of interceptors
(with the event handler wrapped on the end) is indeed stored in the registry
Its all about how things are used
event handlers, by themselves, are not interesting (to re-frame)
The event handler "chain of interceptors" is interesting
So then it seems like the interceptor processing could be wrapped up in a function and used as the value in the kind->id->handler
map.
What is stored is what is needed (by re-frame)
Was the "Yes" in response to using a function as the value for events in the registrar?
Note: subscription handlers are not stored directly either https://github.com/Day8/re-frame/blob/master/src/re_frame/subs.cljc#L317-L351
A wrapped version of the handler you supply is what is stored
What is stored is what re-frame needs. Not directly what you supply
I think what @kenny is saying is that you could store a partial function which closes over the vector of interceptors?
Got it
Anything is possible. Use case? (I have to go ... but will cycle back later and read)
I was just looking into Spec integration with re-frame. It seems like a really clean integration point would be to wrap all the functions stored in the registrar with a function that validates the event/query vec. I have a POC of Spec integration written without doing that and it seemed a bit verbose, given all the handlers are registered using the same mechanism.
I think you could essentially have a single integration point for Spec, which would be really nice.