Scott, There's a ticket for allowing om.core/set-state! and om.core/transact! without re-render. I'm still on the fence about whether such a facility should be included.
And alternative approach would be to save the scroll position some time after the user has finished scrolling with a debounce to allow for many scrolling events. David On Mon, Mar 24, 2014 at 7:05 AM, Scott Nelson <[email protected]> wrote: > I've been working on a little mobile web app in an effort to learn > ClojureScript and Om. > > The source is here: https://github.com/scttnlsn/jot > > The app initially presents a list of items and clicking an item takes the > user to a detail view. When returning to the list view I'd like the > previous scroll position to be restored. My current approach is to save > the scroll position in the app state whenever onScroll is called ( > https://github.com/scttnlsn/jot/blob/master/src/jot/ui.cljs#L94) and then > setting the scroll position when the component mounts ( > https://github.com/scttnlsn/jot/blob/master/src/jot/ui.cljs#L99). > > This has the unintended consequence of re-rendering the list view every > time the list is scrolled. No DOM mutation happens since the render trees > are equal but it feels like the wrong approach. How would you recommend I > handle this scenario? > > Any other advice about the app structure would also be greatly > appreciated. I'm having a blast with ClojureScript and Om so far. > > Thanks! > > - Scott > > -- > 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.
