title: Backbone.js: Elegant way to check if data ready and if the dataset is empty
body: <p>I'm looking for a better solution for two things:</p>
  
  <ul>
  <li><p>How can I understand if the data is fetched and ready, I use <code>BasicDealList.on("reset", function(){})</code> to understand if the data is fetched from ajax and parsed and ready to be used but it feels dirty.</p></li>
  <li><p>If an empty JSON comes from fetching such as <code>{}</code>, it still shows BasicDealList.length as 1 while it should be 0 thus I was forced to check if the first element is empty via <code>collection.length == 1 &amp;&amp; jQuery.isEmptyObject(BasicDealList.toJSON()[0]</code> which is very ugly.</p></li>
  </ul>
  
  <p>Here is the code: </p>
  
  <pre><code>BasicDeal = Backbone.Model.extend();    
  BasicDealCollection = Backbone.Collection.extend({
      model: BasicDeal,
      url: '/some/ajax/url/',
  });
  BasicDealList = new BasicDealCollection();
  
  BasicDealList.on("reset", function(collection, response){
      isEmpty = collection.length == 1 &amp;&amp; jQuery.isEmptyObject(BasicDealList.toJSON()[0]);
      if (isEmpty){
      // render no deal found html
      }
      else{ 
      // render list of deals
      }
  }
  BasicDealList.fetch();
  </code></pre>