marc fawzi
Feb 25, 2017 · 1 min read

The problem is the page model. The whole thing can be simplified if you forget the page model and adopt the “rolling window” model. In that model, you have a rolling window with a preset number of rows (or rows and columns if you’re in a grid) and the window can move up or down as long as there are more rows above it and below it. The bottom most row will always be 1 (or 0 if 0 indexed) and so you can’t move the window farther down that. The top is variable but always growing. Once an item has been added to the top the rolling window increments the top index and you can move the rolling window up by one row, or down, or by N rows in either direction where N is within the range defined by top and bottom.

    marc fawzi

    Written by

    ~stuff~

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight.
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox.
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month.