const request = indexedDB.open('arnellebalane', 1);

request.onsuccess = (e) => {
    console.log(e);
};

request.onerror = (e) => {
    console.error(e);
};

function mirror(...args) {
    return fetch(...args)
        .then((response) => response.json());
}

@@ -3,192 +3,1139 @@
 nst 
-request = indexedDB.open('arnellebalane', 1);%0A%0Arequest.onsuccess = (e) =%3E %7B%0A    console.log(e);%0A%7D;%0A%0Arequest.onerror = (e) =%3E %7B%0A    console.error(e);%0A%7D;%0A%0Afunction mirror(...args
+ifm = (() =%3E %7B%0A%0A    const database = (() =%3E %7B%0A        let db;%0A        const version = 1;%0A%0A        return () =%3E db%0A            ? Promise.resolve(db)%0A            : new Promise((resolve, reject) =%3E %7B%0A                const request = indexedDB.open('idb-fetch-mirror', version);%0A                request.onsuccess = (e) =%3E %7B%0A                    db = e.target.result;%0A                    resolve(db);%0A                %7D;%0A                request.onerror = console.error;%0A                request.onupgradeneeded = (e) =%3E %7B%0A                    db = e.target.result;%0A                    switch (db.version) %7B%0A                        case 1:%0A                            db.createObjectStore('fetch-mirror');%0A                    %7D%0A                %7D;%0A            %7D);%0A    %7D)();%0A%0A    function get(key) %7B%0A        return database().then((db) =%3E new Promise((resolve, reject) =%3E %7B%0A            const transaction = db.transaction('fetch-mirror', 'readonly');%0A            const store = transaction.objectStore('fetch-mirror');%0A            store.get(key).onsuccess = (e) =%3E resolve(e.target.result);%0A        %7D));%0A    %7D%0A%0A    function put(key, value
 ) %7B%0A    
 retu
@@ -1134,74 +1134,664 @@
     
+  
+  
 return 
-fetch(...args)%0A        .then((response) =%3E response.json());%0A%7D
+database().then((db) =%3E new Promise((resolve, reject) =%3E %7B%0A            const transaction = db.transaction('fetch-mirror', 'readwrite');%0A            const store = transaction.objectStore('fetch-mirror');%0A            store.put(value, key).onsuccess = (e) =%3E resolve(e.target.result);%0A        %7D));%0A    %7D%0A%0A    function mirror(path) %7B%0A        const fetchPromise = fetch(path)%0A            .then((response) =%3E response.json())%0A            .then((response) =%3E %7B%0A                put(path, response);%0A                return response;%0A            %7D);%0A%0A        return get(path).then((response) =%3E response %7C%7C fetchPromise);%0A    %7D%0A%0A    return %7B mirror %7D;%0A%0A%7D)();
 %0A

implement idb-fetch-mirror module