Fork me on GitHub
#re-frame
<
2021-12-30
>
Noah Bogart16:12:12

given that we “can” perform side-effects in cofx, how much computation should we be performing within them? for example, I fetch a player’s “deck” (collectible card game) from the database in a cofx. Do I perform the processing of “mongodb deck object” to “game engine deck object” within the cofx or just perform the raw query and let the event-fx handler do that?

p-himik17:12:09

I don't think there's a good objective reason to prefer one over the other. If it's a :get-mongodb-deck-object cofx, then do the processing in the event handler. If it's a :get-game-engine-deck-object cofx, then do the processing right there in the coeffect handler.

👍 1