src/common/idb.js
function getItem(id) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const req = db.transaction(db.name)
        .objectStore(db.name).get(id);
      req.onsuccess = event => resolve(event.target.result);
      req.onerror = event => reject(event);
    });
  });
}
function getItem(id) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const req = db.transaction(db.name)
        .objectStore(db.name).get(id);
      req.onsuccess = event => resolve(event.target.result);
      req.onerror = event => reject(event);
    });
  });
}
function getItem ( id ) { return new Promise ( ( resolve , reject ) => { return instance . pkgs . then ( db => { const req = db . transaction ( db . name ) . objectStore ( db . name ) . get ( id ) ; req . onsuccess = event => resolve ( event . target . result ) ; req . onerror = event => reject ( event ) ; } ) ; } ) ; }
Get packages by instance ID
@param {string} id - Package instance ID
@return {array} data store object
Get packages by instance ID