src/common/idb.js
function getAllItems() {
  return new Promise(resolve => {
    const res = [];
    return instance.pkgs.then(db => {
      db.transaction(db.name)
        .objectStore(db.name).openCursor()
        .onsuccess = event => {
          const cursor = event.target.result;
          if (cursor) {
            res.push(cursor.value);
            cursor.continue();
          } else {
            resolve(res);
          }
        };
    });
  });
}
function getAllItems() {
  return new Promise(resolve => {
    const res = [];
    return instance.pkgs.then(db => {
      db.transaction(db.name)
        .objectStore(db.name).openCursor()
        .onsuccess = event => {
          const cursor = event.target.result;
          if (cursor) {
            res.push(cursor.value);
            cursor.continue();
          } else {
            resolve(res);
          }
        };
    });
  });
}
function getAllItems ( ) { return new Promise ( resolve => { const res = [ ] ; return instance . pkgs . then ( db => { db . transaction ( db . name ) . objectStore ( db . name ) . openCursor ( ) . onsuccess = event => { const cursor = event . target . result ; if ( cursor ) { res . push ( cursor . value ) ; cursor . continue ( ) ; } else { resolve ( res ) ; } } ; } ) ; } ) ; }
Returns all packages
@return {Promise} Promise of list of packages
Returns all packages