re-frame 2023-12-06

I just ran into "https://github.com/Day8/re-frame/issues/536" The fix works, however, I lack an intuition for why we can't use a modified copy of the input map as output. What is it about a cofx map that makes it not suitable as an effects map?

Because coeffects aren't effects. Coeffects - inputs to event handlers. Effects - results of event handlers.

1

If only there were a tautology emoji!

I kind of wish you could do that, too. event-db handlers feel like reducing functions, transforming their argument, but event-fx-handlers have to explicitly build an fx map.

๐Ÿ‘ 1

I guess the confusion stems from the :db coeffect having the same key as the :db effect. On the other hand, :event is a coeffect, but there's no corresponding :event effect.

So basically what makes it not suitable is that it has keys for which there is no registered effect handler.

Whoa, thanks, I definitely did not find that before

I now understand "I guess the confusion stems from the :db coeffect having the same key as the :db effect.", that really helps

just published it, haha

๐Ÿ™ 1

oh okay ๐Ÿ˜‚ that solves the mystery

I am using it in this way everywhere in our code base. We have a clean interceptor which cleans :event and a few other keys on the output. It works very well.

๐Ÿงผ 1