Does this looks attractive to other re-frame users? If so, might be good to show your support https://github.com/day8/re-frame/issues/639#issuecomment-671616527.
(defn set-something [m]
(assoc-in m [:db :something] (get-in m [:event 1])))
(defn fetch-data [m]
(update-in m [:fx] conj {:http {:url "<http://abc.com/endpont>" :method "GET"}}))
(defn dispatch-other [m]
(update-in m [:fx] conj {:dispatch [:other]}))
(reg-event-fx2 :token (comp set-something fetch-data dispatch-other))
Nothing like trying to rewrite re-frame to prove re-frame is well designed. Here's where I got to before I realised that I was missing lots of secondary goodness https://gist.github.com/olivergeorge/875e5a3099e849be0ac4e87baef57fbf
Is it possible to ignore a dispatch in a test?
I don't want to execute a graphql query but want the other events in the dispatch-n to be fired off
You can override an event handler by calling reg-event-fx
again with the same ID.
And modifying the fx map conditionally can be done with a global interceptor that's added only for tests.
I'm using re-com. Is there a built-in way to close a popover when you click outside of it?
:on-cancel
, thanks!
Hi all, I created a new re-frame app with the re-frame-template. With Shadow CLJS running, when I save the app my app is rebuilt but I still have to push refresh to see my updates in the browser. What config do I need to add to see the updates automatically?
@danielmartincraig re-frame-template should create this code for you from https://github.com/day8/re-frame-template/blob/master/src/leiningen/new/re_frame/src/cljs/core.cljs#L18 Did you happen to delete core or re-write it ? Or is that problem reproducible somehow with a freshly generated project ?
Something like this:
(defn ^:dev/after-load render []
(reagent/render [my-root-component] (. js/document (getElementById "app"))))
Thanks!
I got it working now, thanks!