title: Updating Data in Firebase using React
body: <p>I am updating an object in firebase using React js. 
  I'm using this <a href="https://github.com/btomashvili/react-redux-firebase-boilerplate/blob/476c34c8f283f38d7ffefe729b0ce0e0c1a0ff9b/src/app/actions/firebase_actions.js" rel="noreferrer">boilerplate as reference</a>. </p>
  
  <pre><code>  updateBookList: (id, data) =&gt; {
      return firebaseDb.ref('NewBooks').child(id).update(data).then(() =&gt; {
        return {};
      }).catch(error =&gt; {
        return {
          errorCode: error.code,
          errorMessage: error.message
        }
      });
    },
  </code></pre>
  
  <p>The following updates the Books fine. </p>
  
  <p>What I want to do is return the result instead of returning a blank {}. How can I return the result of what I updated?</p>
  
  <p>This is how I fetch books:</p>
  
  <pre><code>  fetchBooks: () =&gt; {
      return new Promise((resolve, reject) =&gt; {
        const bookSub = firebaseDb.ref('NewBooks').on("value", books =&gt; {
          resolve(books.val());
        }, error =&gt; {
          reject(error);
        })
      })
    },
  </code></pre>