I am using an api called ngx-pwa localstorage, which is kind of a wrapper around an indexeddb database. I have a service inside my Angular project that makes calls to the database called getItem:
getItem(key: string) {
    //let data: string;
    var data;
this.storage.get(key).subscribe((dataPassed) => {
   console.log("data passed was", dataPassed); // data is found but not returned
   console.log("typeof ", typeof(dataPassed))
   console.log("data is?")
   data = dataPassed as string
});
return data
}
when the method is called inside my angular component, nothing is returned, even though the item is found inside the subscribe method.
loadData(key) {
    console.log("storage from loaddb", 
this.storage.getItem(key)) // nothing is returned
}
What can I do to get ahold of that data?
 
     
    