Connection Status
The Connection Status component is designed to monitor and react to changes in the user's internet connection status. This component provides a simple way to show a notification or change the state of your application when the user's device goes offline or comes back online.
Usage
To use the Connection Status component, include it in your application and initialize it with the necessary options. Below is an example of how to integrate the Connection Status component into your project:
Parameters
onlineMessage
: Message displayed when onlineofflineMessage
: Message displayed when offline
Actions
None
Targets
message
: HTML tag to update with the connection status message. Multiple targets allowed.attribute
: HTML attributedata-connection-status="ONLINE"
(or"OFFLINE"
) will be set depending on the connection status. In the example above, this attribute is used to change the applicable classes
Events
On status change, the event status-changed
is dispatched. The payload property contains the following data:
status:
"OFFLINE"
or"ONLINE"
message
: the message set as parameter or the default value.
Last updated