Hey, I hope that some of the answers are helpful. On Tuesday, April 8, 2014 2:43:38 PM UTC-4, Nikita Prokopov wrote: > Hi! > > > > I’ve tried to get through Om tutorials and cursors are still most mysterious > part of it for me. I mean, idea is clear, but practice is filled with a lot > of pitfalls. > > > > I'm looking for help in understanding them. These are the questions I believe > could make nice introduction and help people like me understand the idea > fully: > > > > what’s cursor See Below. > > what operation does it support A cursor is how you pass data around Om and how Om knows which components care about which data and therefore which components to update when the data changes.
> > how and when to update the cursor, how changes are propagated to the core > state (atom) You update the cursor by using some of the methods here like transact! (https://github.com/swannodette/om/wiki/Documentation#transact) The changes are propagated up to the root cursor, however, not the core state atom. The clarify, when you pass the core state atom into om/root a root cursor is returned which is operated on for all application state changes. > > how to create a cursor from atom A cursor is created from an atom generally containing hash-map that is passed in as the "root cursor" to om/root. > > how to convert cursor to data This is done for you by om. > > how to create cursor from cursor Whenever you access an item from the cursor you are returned a new cursor which includes an updated path to the root cursor. The path is sort of like a trail of breadcrumbs that tell cursors down the app tree how to reach the root cursor. > > how are cursors related to render, why render is so special for them Not sure from your question. > > how exactly component state is dependent on a cursor Presumably the cursor for each component owns data that the component cares about and binds to. > > what’s the role of IValue and ICloneable in cursors life? Not sure. > > why do we have to implement ICloneable on Strings (in an immutable language!) > in order for cursors to work? Not sure. > > > > Looking for answers. Thanks! -- 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.
