I too have been thinking about the concept of cursors. Cursors are meant to enable reusable components but the way I see it they can easily couple your view code with the rest of your program (they are mutable and are meant to be used that way). If every component takes (and uses) a cursor are we back to a network of mutable stuff?
I think you can achieve the same level of reuse with either callbacks or channels. As a simple example should a button component expose an on-click event (or a click channel) or fiddle with application state directly via cursors, which is more reusable? I suppose it’s possible to not use cursors when you don’t have to and I think that in many cases it’s better for components to not handle state changes directly themselves and instead emit (either via channels or callbacks) data about user interactions which can be handled separately by a different part of your program. On Tuesday, April 8, 2014 9:43:38 PM UTC+3, 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 > > what operation does it support > > how and when to update the cursor, how changes are propagated to the core > state (atom) > > how to create a cursor from atom > > how to convert cursor to data > > how to create cursor from cursor > > how are cursors related to render, why render is so special for them > > how exactly component state is dependent on a cursor > > what’s the role of IValue and ICloneable in cursors life? > > why do we have to implement ICloneable on Strings (in an immutable language!) > in order for cursors to work? > > > > 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.
