Hi all, having written a non-trivial app in om I am thinking of prototyping it 
in reagent. Before doing that I want to clarify a few things.

Some relevant background:
 - the app has multiple pages, but only one page is in the dom at any one time 
(i.e. I am not hiding anything it simply isn't rendered)
 - a page has multiple components only some of which will be in the dom at any 
one time (as before, nothing is hidden it simply isn't rendered)
 - when switching between pages the previous state of the page should be 
retained. This means storing which components are visible and scrolling 
positions etc. in the app-state
 - communication happens over async channels which are managed in IWillMount 
and IWillUnmount

om's common approach (although it isn't enforced by om) of everything in one 
atom works well here as the lifecycle of data isn't tied to the lifecycle of 
the component. om's excellent cursor mechanism goes a long way to allowing 
component rendering lifecycle to be restricted to its little bit of the global 
app-state which has significant performance benefits.

In reagent, I understand there isn't such a thing as global state (although of 
course you could go down that route), rather each component/component hierarchy 
gets their own atom.

My questions are:
 - how to handle the state of non-rendered components. Am I going to end up 
with an om-like single atom (albeit per page)? Without om's cursors (I believe 
reagent's cursors are clever syntatic sugar and don't contribute to efficiency 
- is that right?) isn't this going to be very inefficient?
 - where are channels typically configured in reagent? Am I going to end up 
r/create-class or r/with-meta everywhere?

To be blunt, I see lots of people move away from om to reagent, but from where 
I sit (in ignorance of reagent) it doesn't seem a win in this situation. But I 
know I'm not doing anything special - these are all happy cases so I must be 
missing something. 

So, rather than recreate an 'om-style app' in reagent and fight reagent's 
selling points (e.g. localised state and low-ceremony) I thought I would ask 
how does reagent solve these problems.

Thanks all :).

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to