Well, I can report that calling reagent/flush at the end of my event handler 
appears to have the desired effect.

I can’t say that it fills me with confidence, however—without understanding 
why/how it “may not work”, I’m concerned that it might bite me on the arse 
later.

Any suggestions for where to find or infer a definitive answer would be most 
welcome.

--
paul.butcher->msgCount++

Silverstone, Brands Hatch, Donington Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
Skype: paulrabutcher

Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
http://pragprog.com/book/pb7con

On 28 October 2014 at 00:13:58, Mike Thompson ([email protected]) wrote:

On Tuesday, October 28, 2014 10:24:01 AM UTC+11, Paul Butcher wrote:  
> Just after sending this, I stumbled across reagent/flush:  
>  
>  
> https://github.com/holmsand/reagent/blob/master/src/reagent/core.cljs#L123  
>  
>  
> But the documentation says:  
>  
>  
>  
> Note that this may not work in event handlers, since React.js does batching 
> of updates there.  
>  
>  
>  
> Which is a nuisance, as within an event handler is exactly where I’d like to 
> call it :-)  
>  
>  
> Does anyone have any suggestions about what the “may” in that sentence means? 
> And, for that matter, what “not work” means? I’m struggling to infer how 
> batching interacts with event handling from reading the source.  
>  
>  
> All I care about, in my particular case, is that the changes to the DOM that 
> result from processing the current event have all happened before the next 
> event is processed…  


Hi Paul,  

Its not an answer, but as further background, I'd point you to this 
information:  
http://holmsand.github.io/reagent/news/reagent-is-async.html  

--  
Mike  



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

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