Forráskód Böngészése

added utilFunction to check internet Connectivity

Abhinav-grd 4 éve
szülő
commit
fe7e056935
1 módosított fájl, 9 hozzáadás és 0 törlés
  1. 9 0
      src/utils/common/utilFunctions.ts

+ 9 - 0
src/utils/common/utilFunctions.ts

@@ -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);
+    }
+}