title: Fetching data from Firestore
body: <p>So I am trying to fetch data from Firestore, when I console log it I got the content of my collection back, but when I move the code to a function I am not able to return it back.</p>
  
  <p>This code works:</p>
  
  <pre><code>const db = firebase.firestore();
  db.settings({ timestampsInSnapshots: true});
  db.collection('story').get().then((snapshot) =&gt; {
  snapshot.docs.forEach(doc =&gt; {console.log(doc.data())
      ;})
  })
  </code></pre>
  
  <p>This doesnt work. (it compiles, but doesn`t return anything):</p>
  
  <pre><code>...
  getMyStory = () =&gt; {
          const db = firebase.firestore();
          db.settings({ timestampsInSnapshots: true});
          db.collection('story').get().then((snapshot) =&gt; {
          snapshot.docs.forEach(doc =&gt; {
              let items = doc.data();
          })
          });
          return this.items;
      }
  
  
      render () {
  
  
          return (
          &lt;p&gt;{this.getMyStory}&lt;/p&gt;
  );
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>