this is my code
const openDb = async() => {
  var db: IDBDatabase;
    var request =  await indexedDB.open("adminDB");
     request.onsuccess = (event: any) => {
      db =  event.target.result;
    };
    return db;
}
what i'm trying to do is to await for db =  event.target.result; to be done before return db;
how can i do that? i know basicly how async/await works for functions but it does not seem to be the same for this situation. any help plz
