I think I'm experiencing something related to this.  I have a few secretary 
(https://github.com/gf3/secretary) routes setup and each handler renders a root 
component into the document body.  I'm encountering a strange timing issue 
after doing the following:

- update the app state atom (this causes a re-render of the current root 
component)
- dispatch a new route handler (which calls om/root again with a new component)

It seems like about half of the time the new component is never displayed.  
Inserting a small delay between the two steps fixes the problem which is why I 
suspect this is a timing issue.

On Friday, February 7, 2014 8:01:21 PM UTC-5, David Pidcock wrote:
> You got me thinking : if we're storing drop-index,  why not just use it 
> during the build phase as follows : 
> 
> (apply dom/ul #js {:className "sortable" :ref "sortable"}
>     (flatten (map-indexed
>                                       (fn [idx item]
>                                          [(when (= idx (:drop-index state))
>                                             (sortable-spacer (second 
> (:cell-dimensions state))))
>                                           (om/build line-item item {:opts 
> opts :key :id} )
>                                           ]) 
>                                         init-list ))))))
> 
> Which gives us the spacer item in the right place without "adulterating" the 
> list with it. Not sure if flatten here will perform any better than the 
> insert-at function, but I'm not quite sure if there's a better way to achieve 
> this sort of thing. 
> 
> On Friday, February 7, 2014 4:37:24 PM UTC-8, David Pidcock wrote:
> > Hmm, really?  How would you do it differently? 
> > Seems like the perseus orderer uses the same technique  (slicing out the 
> > card you're about to drag, and inserting a placeholder at that index 
> > instead)
> > 
> > On Friday, February 7, 2014 10:25:41 AM UTC-8, David Nolen wrote:
> > > Without a minimal case it's hard for me to understand what the problem 
> > > is. I will say the spacer technique in my sorting example was a simple 
> > > hack and not the way I would do a sortable - I suspect it may be the 
> > > source of some of these issues.
> > > 
> > > 
> > >

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