Reading some reagent code and comparing to similar code in om I've notice that 
in reagent using a :key property in the component is much more frequent.

Noticing this I have one doubt about the efficiency of the rendering in 
reagent/om without using the key.

For example, consider a simple list, where the previous virtual dom was:

- A
- B
- C

and we add at the front now is:

- D
- A
- B
- C

If I don't use keys all elements in the tree have changed position and all of 
them are re-rendered.

If we add at the end, that is:

- A
- B
- C
- D

only D is rendered and added to the tree.

So, in the first case, I shoud use a key that allos comparation without 
resorting to position, and in the second one, this is not necessary.

If this is correct, why the key is not used as frequently in om? 

Am I right or completely comfused in this?

JM

-- 
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