Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
Yes I've found that using channels to communicate back up the tree and propagating changes back down works reasonably well. Just takes some getting used to. On Wednesday, January 15, 2014, Ruslan Prokopchuk wrote: > Component is dropped by user near some position, in render this component > sees

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
Yes. On Wednesday, January 15, 2014, Laurent PETIT wrote: > > 2014/1/15 David Nolen 'dnolen.li...@gmail.com');>> > >> It's ok to update component local state during render via om/set-state!, >> I don't see a good use case for updating global application state from >> render. >> >> david >> > > >

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Laurent PETIT
2014/1/15 David Nolen > It's ok to update component local state during render via om/set-state!, I > don't see a good use case for updating global application state from render. > > david > Shouldn't that be considered a very bad smell ? > > > On Wed, Jan 15, 2014 at 9:09 AM, Ruslan Prokopc

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
Component is dropped by user near some position, in render this component sees it and snaps itself to this position. Then component and position ids should be reported to app global state. I've done it in render, but now I think about putting message with ids into core.async channel and process

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
It's ok to update component local state during render via om/set-state!, I don't see a good use case for updating global application state from render. david On Wed, Jan 15, 2014 at 9:09 AM, Ruslan Prokopchuk wrote: > David, but is it ok to update component & app state in render? My > knowledge

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
David, but is it ok to update component & app state in render? My knowledge about Om/React is still very incomplete, so I don't understand fully how things should be organized. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this me

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
I don't see the problem with flowing layout information down the tree. David On Wed, Jan 15, 2014 at 8:55 AM, Ruslan Prokopchuk wrote: > I'm struggling for best solution in the following case: > > I have component representing svg node with some content which has to be > centered in it and havi

[ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
I'm struggling for best solution in the following case: I have component representing svg node with some content which has to be centered in it and having some other properties derived from node dimensions. To achieve this I created listener for window resize which update state of component wit