isOnline
The isOnline function checks if the browser is currently connected to the internet.
Syntax
typescript
isOnline(): boolean;Parameters
| Name | Type | Description |
|---|---|---|
| – | – | This function does not take any parameters |
Returns
| Name | Type | Description |
|---|---|---|
| – | boolean | true if online |
Examples
typescript
isOnline();
// => trueNotes
- Useful for adapting features based on connectivity.
