On Monday, March 24, 2014 3:52:32 PM UTC-7, Scott Nelson wrote:
> I need the scroll state to persist beyond a single lifecycle of the list 
> component which is why a purely local treatment is not sufficient (to my 
> knowledge).  The scroll position could be tracked locally (either in a 
> buffered channel like you mention or directly in the local state) but would 
> ultimately need to be stored somewhere outside of the component (perhaps on 
> IWillUnmount).
> 
> I think the only way to avoid a re-render is to store the scroll state in a 
> separate, global atom.  I think I'd rather deal with the re-renders and 
> perform some debouncing to keep them minimal.

Hmm - that might work.  Use the sliding channel of size 1 to keep only the 
latest scroll event, and then only  read from that in WillUnMount,   pushing it 
into app-state at that time. 
Then read from app-state in DidMount.    
That will probably cause an extra render, but hopefully only one.

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