> Quite another thing is if it is a good idea to do that :-) If possible, I'd 
> say it is better to keep state that belongs together in a single atom.

Am looking at this from a performance point of view. You're marking components 
as dirty when there's any change in an atom being deref'ed by the component, 
right?

But I'm guessing it's quite common for a component to be dealing with only a 
small subset of the data within a larger state atom. (This is what Om's cursors 
are addressing, it seems). In that case (please correct me if I'm wrong) - the 
number of needless rerenders will grow with the number of component-irrelevant 
bits of information in each atom.

One simple way of addressing that is to use more, smaller atoms - or to use 
"views" on atoms (as Reflex does). For example instead of marking a component 
as dirty when @my-atom changes, we could mark it as dirty only when 
`(:relevant-submap @my-atom)` changes.

Does that make sense, or am I misunderstanding something?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to