added utilFunction to check internet Connectivity
This commit is contained in:
parent
f5f2490c86
commit
fe7e056935
1 changed files with 9 additions and 0 deletions
9
src/utils/common/utilFunctions.ts
Normal file
9
src/utils/common/utilFunctions.ts
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue