Extensions add specific functionality to Items API. They rely on modules within LT being available.
--
Checks for an active network connection. If none found, adds an icon to the UI to indicate the status to the end user.
Can also be used to check the current download speed.
Methods
checkConnection() → {promise}
Checks for network connectivity using a HEAD request.
- Since
- 2.12.0
- Resolves to true if the request is successful, false otherwise.
- Returns:
- promise
checkSpeed() → {string}
Checks the current download speed using the Network Information API.
- Since
- 2.25.0
- The current download speed in Mbps or a message indicating that the API is not supported. Eg
10 Mbps
. - Returns:
- string
run(optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options | object | <optional> | Optional configuration object includes:
|
- Since
- 2.12.0
Example
import { LT } from '@caspingus/lt/assessment';
LT.init(itemsApp); // Set up LT with the Items API application instance variable
LT.extensions.networkStatus.run();