# StateThe Network Information API provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). This can be used to select high definition content or low definition content based on the user's connection. The entire API consists of the addition of the NetworkInformation interface and a single property to the Navigator interface: Navigator.connection.
The useNetwork
function exposes the following reactive state:
This is the TypeScript interface for the state:
State Type Description isOnlineboolean
If the user is currently connected. offlineAt Date | undefined
The time since the user was last connected. downlink Number | undefined
The download speed in Mbps. downlinkMax Number | undefined
The max reachable download speed in Mbps. effectiveType string | undefined
The detected effective speed type. saveData boolean| undefined
If the user activated data saver mode. type string | undefined
The detected connection/network type. # Example
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4