title: How to update data with .transaction while maintaining priority?
body: <p>I did not find any documentation on how update a value in Firebase using '.transaction' while also maintaining priority like '.setWithPriority' does. I have this working but just looking for some feedback on best practices with Firebase API. Here is a snippet of the code I am working with:</p>
  
  <pre><code>userScoreRef.once('value', function(snapshot) 
  {
      if(snapshot.val() === null) {
          // Create a new participant.
          userScoreRef.setWithPriority({ Participant: participant, CurrentScore: 0 }, 0);             
      }
      else {
          // Update participant score.
          userScoreRef.child("CurrentScore").transaction(function(_currentScore) {
          _currentScore++;
          userScoreRef.setWithPriority({ Participant: participant, CurrentScore: _currentScore }, _currentScore);
          return;})// DO NOT UPDATE WITH TRANSACTION! Let setWithPriority perform the data update.
      }
  })
  </code></pre>
  
  <p>As you can see I am:
  1) Pulling the current value from Firebase w/ .transaction, 2) using .setWithPriority to set the data, finally 3) simply returning on the transaction call to cancel it. </p>