MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / remove

Method remove

data/src/storage.js:67–88  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

65 })
66 }
67 remove(key) {
68 return new Promise((resolve, reject) => {
69 if (!window.indexedDB) return resolve();
70 let openRequest = indexedDB.open(this.dbName, 1);
71 openRequest.onerror = () => {};
72 openRequest.onsuccess = () => {
73 let db = openRequest.result;
74 let transaction = db.transaction([this.storeName], "readwrite");
75 let objectStore = transaction.objectStore(this.storeName);
76 let request2 = objectStore.delete(key);
77 this.addFileToDB(key, false);
78 request2.onsuccess = () => resolve();
79 request2.onerror = () => {};
80 };
81 openRequest.onupgradeneeded = () => {
82 let db = openRequest.result;
83 if (!db.objectStoreNames.contains(this.storeName)) {
84 db.createObjectStore(this.storeName);
85 };
86 };
87 });
88 }
89 getSizes() {
90 return new Promise(async (resolve, reject) => {
91 if (!window.indexedDB) resolve({});

Callers 15

constructorMethod · 0.45
setupAdsMethod · 0.45
adBlockedMethod · 0.45
startButtonClickedMethod · 0.45
startGameMethod · 0.45
setElemMethod · 0.45
closePopupMethod · 0.45
showMethod · 0.45
createBottomMenuBarMethod · 0.45
openCacheMenuMethod · 0.45
setVirtualGamepadMethod · 0.45

Calls 1

addFileToDBMethod · 0.95

Tested by

no test coverage detected