async testMethod() {
let temp = [];
return await new Promise(resolve => {
const db = indexedDB.open("EPG");
db.onsuccess = (event) => {
let target = event.target.result;
let tx = target.transaction(["channel"]).objectStore("channel").openCursor();
tx.onsuccess = (event) => {
let cursor = event.target.result;
if (cursor) {
temp.push(cursor.value);
cursor.continue();
} else {
resolve(temp);
}
}
}
});
}
var myArr = await testMethod();