I have a DB function as shown below:
If I want to use the results of this query in a page module, where do I call this function? Do I call it in the constructor or the lifecycle method (ionViewDidLoad, ionViewDidEnter). Please advise.
Currently I call it in the constructor but it seems like it slows down the app. I am not sure if I am doing the right thing
getAddressDetails() {
return new Promise((resolve, reject) => {
let sql = "select * from tablename"
this.database.executeSql(sql, []).then((data) => {
resolve(data)}
});
}```