added utilFunction to check internet Connectivity

This commit is contained in:
Abhinav-grd 2021-02-22 13:06:32 +05:30
parent f5f2490c86
commit fe7e056935

View file

@ -0,0 +1,9 @@
import errorCodes from './errorCodes';
export function checkConnectivity() {
if (navigator.onLine) {
return true;
} else {
throw new Error(errorCodes.ERR_NO_INTERNET_CONNECTION);
}
}