There's a whole section in the wiki dealing with more custom handling, routing, etc: https://github.com/Day8/re-frame/wiki/Alternative-dispatch,-routing-&-handling
That should help. On Monday, March 28, 2016 at 1:13:39 PM UTC-7, Luke Horton wrote: > Why does the re-frame framework restrict a 1:1 between dispatches and > handlers? > > At first I found it a little weird. I can think of lots of realistic cases > where: > > ``` > some event happens -> module a responds; module b responds; > ``` > > Then I thought... well, if one module has a handler that changes the app-db, > every other module only needs to subscribe to the same query, and they won't > *need* to also handle that event, it will happen reactively: > > ``` > some event -> module a responds (change db value) -> module b reacts to > change; > ``` > > But then I remembered that very frequently I need to handle this behavior: > > some event -> module a responds (starts fetching new data) ... eventually > updates db; > > Which I can't seem to fit into the paradigm of 1:1 handler to event. > > If we only have a 1-handler per event restriction, how can I also have: > > some event -> capture event in module a (start fetching new data); ??? ; > capture event in module b (start fetching a different set of data); > > Receiving the data would be relatively straightforward ... dispatch separate > events (from a receiving chan) for [:a-data] and [:b-data], but how we > implement in a decoupled manner the initial "go get data" across different > modules is lost on me. > > Any suggestions / patterns for solving this would be helpful. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
