I use this service class in order to get the network status:
@Injectable()
export class NetworkConnectionService {
constructor() {
}
addNetworkConnectionListener() {
Network.addListener('networkStatusChange', status => {
console.log('Network status changed', status);
});
}
getCurrentNetworkStatus() {
const self = this;
const currentNetworkStatus = async () => {
const status = await Network.getStatus();
};
return currentNetworkStatus;
}
}
and I want to get the status string in order to print it in html. How do I get this string?
Network? Why do you create a async function inside an async function? And why does the inner function return nothing? This code makes no sense to me, and is expected to not return the status.