function transactionPromise(transaction) {
  return new Promise((resolve, reject) => {
    transaction.onabort = () => {
      reject(transaction.error);
    };
    transaction.oncomplete = () => {
      resolve();
    };
  });
}
@description - This function will wrap an IDBTransaction in a promise,
               resolving in the oncomplete() method and rejecting with the
               transaction error in the onabort() case.
@param {IDBTransaction} transaction - The transaction to wrap in a promise.
@returns {Promise} - A promise that resolves when the transaction is either
                     aborted or completed.