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
Returns
- Resolves to true if the request is successful, false otherwise.
- Type
- (promise)
checkSpeed() → {string}
Checks the current download speed using the Network Information API.
Since
- 2.25.0
Returns
- The current download speed in Mbps or a message indicating that the API is not supported. Eg
10 Mbps
.
- Type
- (string)
run(optionsopt)
Since
- 2.12.0
Example
import { LT } from '@caspingus/lt/src/assessment/core';
import * as networkStatus from '@caspingus/lt/src/assessment/extensions/ui/networkStatus/index';
LT.init(itemsApp); // Set up LT with the Items API application instance variable
networkStatus.run();
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object |
<optional> |
Optional configuration object includes:
|