title: Trouble storing PouchDB data in a variable
body: <p>I don't know why, but for some reasons I have trouble getting data from my indexedDB using PouchDB and storing that data in a variable.</p>
  
  <p>I have a function that fetches all the data from my database, like this:</p>
  
  <pre><code>load_all = function() {
    var database = new PouchDB('ProjectDB');
    var remoteCouch = false;
    database.allDocs({include_docs: true, descending: true}, function(error, doc) {
      if (error) ...
      else {
        if (doc.rows.length &gt; 0) return doc.rows;
        else ...
      }
    });
  }
  
  var projects = load_all();
  console.log(projects); // will log 'undefined'
  </code></pre>
  
  <p>I have no idea why it wont, work.</p>