title: how to return promise in firebase set()
body: <p>I want to receive success if data is pushed correctly to firebase or catch an error if rejected. I tried such a code:</p>
  
  <pre><code>db.push().set(todo).then(snap =&gt; {
        console.log(snap);
  
      });
  </code></pre>
  
  <p>but SNAP, callback, IS UNDEFINED . How do I need to use promises here? </p>