title: How to power a windowed virtual list with cursor based pagination?
body: <p>Take a windowed virtual list with the capability of loading an arbitrary range of rows at any point in the list, such as <a href="https://codesandbox.io/s/5wqo7z2np4" rel="nofollow noreferrer">in this following example</a>.</p>
  <p>The virtual list provides a callback that is called anytime the user scrolls to some rows that have not been fetched from the backend yet, and provides the start and stop indexes, so that, in an offset based pagination endpoint, I can fetch the required items without fetching any unnecessary data.</p>
  <pre class="lang-js prettyprint-override"><code>const loadMoreItems = (startIndex, stopIndex) =&gt; {
    fetch(`/items?offset=${startIndex}&amp;limit=${stopIndex - startIndex}`);
  }
  </code></pre>
  <p>I'd like to replace my offset based pagination with a cursor based one, but I can't figure out how to reproduce the above logic with it.</p>
  <p>The main issue is that I feel like I will need to download all the items before <code>startIndex</code> in order to receive the cursor needed to fetch the items between startIndex and stopIndex.</p>
  <p>What's the correct way to approach this?</p>