public/js/idb.js
// This function will be executed if we attempt to submit a new budget and there's no internet connection
This function will be executed if we attempt to submit a new budget and there's no internet connection
This function will be executed if we attempt to submit a new budget and there ' s no internet connection
function saveRecord(record) {
  const transaction = db.transaction(["new_budget"], "readwrite");
  const budgetObjectStore = transaction.objectStore("new_budget");
  budgetObjectStore.add(record);
}
function saveRecord ( record ) { const transaction = db . transaction ( [ "new_budget" ] , "readwrite" ) ; const budgetObjectStore = transaction . objectStore ( "new_budget" ) ; budgetObjectStore . add ( record ) ; }
This function will be executed if we attempt to submit a new budget and there's no internet connection
This function will be executed if we attempt to submit a new budget and there ' s no internet connection
// open a new transaction with the database with read and write permissions // access the object store for `new_budget` // add record to your store with add method