Fork me on GitHub
Vincent Cantin00:01:49

Hi. I am new to Clojurescript, and I learned OM Next so far. I would like to know if Reagent also can be used to find what data a component needs in order to be displayed so it can be fetched from the server just when needed.


@vincent.cantin Regarding your question about reagent, I’m not sure if I follow what you are asking 100%, but as far as I know, the only thing reagent does for you is track dereferences to ratoms and trigger renders based on any subsequent mutations of those atoms. I’ve only taken a superficial look at om next, but my understanding is that you have to do some explicit work to say what data you want, though apparently it can do the fetching and synchronization for you.

Vincent Cantin08:01:06

Yeah, OM Next requires to do some explicit declaration of the needed data. I was hoping that those dependencies could instead be derived from the render function in an automatic manner, so the user of the library does not have to repeat himself. I feel that this derivation could be done more easily when using Reagent, but I am not sure of that, maybe my reasoning is too naive about automatic data fetching.


My naive view is that the om/re-frame/citrus approaches are all about making things fairly explicit, whereas reagent and rum do more automatic tracking for you. My internal model has been the difference between a flux architecture and a mobx type library.

Vincent Cantin08:01:54

@lee.justin.m: thx, I didn't know all those libraries. I will take a look at them.