Fork me on GitHub
#re-frame
<
2019-01-28
>
Whiskas00:01:42

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

Whiskas00:01:43

[whiskas.re-frame/tracing “0.5.2-re-debux”]

ag20:01:28

is day8.re-frame/tracing 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]))

kasuko21:01:09

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.

kasuko21:01:32

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

kasuko21:01:00

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

kasuko21:01:51

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.

kasuko21:01:22

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"