On 13 jan 2014, at 18:41, Bob Hutchison <[email protected]> wrote:
> I’m running in my browser, right now, a function that updates the render 
> state and React is given the opportunity to redraw before the function 
> continues (i.e. it re-renders right after the swap!). This is certainly 
> within the rules. If you have multiple atoms that need to be updated then 
> you’ll potentially see React re-render between each atom update… i.e. there 
> will be React renders where the atom values are uncoordinated/inconsistent 
> (possibly doing silly stuff on the screen, momentarily at least). I can 
> imagine some very crude techniques to prevent this, do you know any good ones 
> (beside putting all state in one atom (which, personally, I had been planning 
> to do anyway))?

Aah, I see. That is a very good question: most of the time you shouldn't see 
any inconsistent output, since React normally batches updates – but only in 
React's own event handlers. There are ways around that, but none of them are 
very attractive...

It would probably be worthwhile to have a way to tell React to do the batching 
thing outside event handlers as well (sort of like dosync), but I don't think 
that React exposes enough API for that yet (at least not last time I looked).

File an issue on Github if this turns out to be a real problem :)

/dan

-- 
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.

Reply via email to