On May 5, 2014, at 1:33 PM, Roger Gilliar <[email protected]> wrote: > I found the cause of the problem. The components gets rendered twice. On the > first call services is nil (therefore it is nil in init state). On the second > call it is not nil. > > Still don't know why the component gets rendered twice.
render and render-state are called a lot more often than you might expect - any time there is a change to the (relevant part of the) global state or to a component's local state (note that the DOM isn't necessarily redrawn for each call to render). That means you need to think carefully about how and where you are modifying the global / local state - anything that is not "changing" is probably better placed in options (e.g., channels etc). Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880)
signature.asc
Description: Message signed with OpenPGP using GPGMail
