title: How to fetch data when scroll to bottom in react native with firestore?
body: <p>I'm using react-native with <code>redux</code>, <code>redux-thunk</code> and <code>firebase/firestore</code>.</p>
  
  <p>I wonder how to make pagination with firestore. I know it's written in document but I couldn't figure it out.</p>
  
  <p>Now, I'm trying to make that whenever scroll down and it reaches bottom then fetch next data.</p>
  
  <p>example code is below.
  </p>
  
  <pre><code>var first = db.collection("cities")
          .orderBy("population")
          .limit(25);
  
      return first.get().then(function (documentSnapshots) {
    // Get the last visible document
    var lastVisible = documentSnapshots.docs[documentSnapshots.docs.length-1];
    console.log("last", lastVisible);
  
    // Construct a new query starting at this document,
    // get the next 25 cities.
    var next = db.collection("cities")
            .orderBy("population")
            .startAfter(lastVisible)
            .limit(25);
  });
  </code></pre>
  
  <p>I'm using react-redux, so I need to change this code.
  So I guess I need to store the lastVisible as state.
  But then How can I call this event?</p>