“Infinite scroll” Useful when… pagination would be ugly client wants to display 1k+ items for whatever reason making something not laggy What is this “Scroll Table”?
Pretty much can’t -- only so many gigahertzies Solution Only rows clients can see need to be visible Cuts down our workload from O(N) to O(1) Sounds like magic
of like React Uses Queries for what needs to change Eval for getting the new state More involved - being simplified in the next major version http://www.slideshare.net/jdegoes/halogen-past-present-and-future`
calculateVisibleIndices model scrollTop = case model of { rowHeight, rowCount, height } -> do let firstRow = scrollTop / rowHeight let visibleRows = (height + 1) / rowHeight let lastRow = firstRow + visibleRows model { visibleIndices = firstRow..lastRow } eval :: Natural Query (ComponentDSL State Query g) eval (UserScroll e next) = do modify $ \s -> calculateVisibleIndices s e pure next