Skip to content

Commit

Permalink
object store created
Browse files Browse the repository at this point in the history
  • Loading branch information
rajnidua committed Oct 13, 2021
1 parent a5b4aab commit b1e949f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions public/db.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
let db;

// We request a database instance.
const request = indexedDB.open("budgetDatabase", 1);

// Create an object store inside the onupgradeneeded method.
request.onupgradeneeded = ({ target }) => {
const db = target.result;
const objectStore = db.createObjectStore("budgetDatabase");
console.log(objectStore);
};

// This returns a result that we can then manipulate.
request.onsuccess = (event) => {
console.log(request.result);
Expand Down

0 comments on commit b1e949f

Please sign in to comment.