[ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Andrew
I've been using get-state in my event handlers without problem, but I'm wondering if I should be concerned by not treating these in the same way I treat app-state cursors, which generally should not be read in an event handler, correct? That is, while update! and transact! are usually fine in an

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Daniel Kersten
I always communicate values to children to keep them decoupled from their parents. I don't think there's any technical reasons to avoided your approach, but I don't like components relying directly on the structure of other components. I also try to represent the bulk of my state in the cursor and

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Daniel Kersten
Minor typo correction: " I know if my components use *-nr! functions because all of my state access is local to the function" That was meant to say "local to the component". On Mon, 15 Dec 2014 08:54 Daniel Kersten wrote: > I always communicate values to children to keep them decoupled from th

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Andrew
Thanks Daniel. Two followups: You say that render-state destructuring is preferable to using get-state, but of course render-state is only going to show you that component's own state, and thus using get-state would be necessary if accessing another component's state. I understand your point ab

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Daniel Kersten
Apparently David is relaxing the restriction of not being able to access cursor outside of the render phase without dereferncing, although it's my understanding that deref is still necessary if you require an up to date view of the cursor, so it's probably still variable to make the distinction bet

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Andrew
On Monday, December 15, 2014 10:35:19 AM UTC+1, Daniel Kersten wrote: > Apologies for bad formatting and typos, not easy typing code on a phone :) Well you are in luck then, for mobile coding, since a shiny new Clojure IDE is included as standard on the new Apple Watch. -- Note that posts from

Re: [ClojureScript] Reading local state in event handler in Om

2014-12-15 Thread Daniel Kersten
Hah, nice! Pity I'm on Android then ;-) On Mon, 15 Dec 2014 09:39 Andrew wrote: > On Monday, December 15, 2014 10:35:19 AM UTC+1, Daniel Kersten wrote: > > > Apologies for bad formatting and typos, not easy typing code on a phone > :) > > Well you are in luck then, for mobile coding, since a shi