On Mon, Jan 13, 2014 at 1:39 PM, Dan Holmsand <holms...@gmail.com> wrote:

> On 13 jan 2014, at 18:41, Bob Hutchison <hutch-li...@recursive.ca> 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...
>

FWIW, this is something I wanted to solve in Om. Application state updates
are *always* batched, rendering always occurs on requestAnimationFrame
(where available), and there's some basic enforcement logic around trying
to update the app state from event handlers to work around inconsistency.

David

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to