Fork me on GitHub

ok, just published a re-frame.tracing version that is compatible with debux


[ “0.5.2-re-debux”]


is and specifically fn-traced is still relevant? I thought its functionality was pulled into 10x project. I’m asking because I’ve stumbled on a project that uses them both and I’m curious if fn-traced still needed

Jacob Haag21:01:54

What is the best practice for dispatching an event that needs to associate two values to two seperate keys in the db?

:on-click #(do (re-frame/dispatch [::events/toggle-foo])
                         (re-frame/dispatch [::events/set-foo @some-subscription]))


This is something I have struggled with for a while and came to the realization that I was using events wrong. I was trying to use them like actions, which it seems like that's what you are doing too.


The premise is that whatever thing's on-click you are registering to should be it's own event


For example I would have a search button and it would dispatch multiple events like update-search-term and clear-search-bar but those weren't actually modelling the event that came into the system from the user, which was just simply a search event


Then how do you deduplicate the code behind the scenes, you can either dispatch those 2 further events via an effect, or reuse functions within the same event handler that the other event handlers would use.


I am assuming that whatever on-click this is isn't like a button with a label "Toggle foo and also set foo to some subscription"