Login to follow
OfflineDetectionReactive

OfflineDetectionReactive (ODC)

Stable version 0.1.0 (Compatible with ODC)
Uploaded on 23 October 2023 by OutSystems Labs
OfflineDetectionReactive

OfflineDetectionReactive (ODC)

Documentation
0.1.0

The component is based on the OfflineJS library and is composed by the OfflineDetectionEvents block and the IsOffline client action. There are no external dependencies.

OfflineDetectionEvents
​Block that triggers OfflineDetection events based on connection changes


When to use

When an application is required to react to connection changes.


How to use

Drag the block into a different block or screen and then create a new action handler for any of the relevant events for your use case.





The 3 warning placeholders are only displayed when the ShowWarningMessage flag is set to true, meaning the triggered events will also add visual feedback. Consider changing their content and override their CSS styles to better fit your app experience.




If you need to handle the OfflineDetection events throughout the whole application, consider placing the block in the layout itself.

The events triggered by the block are:

  • Checking: Whenever we are testing the connection
  • ConfirmedOffline: A connection test has failed, fired even if the connection was already offline
  • ConfirmedOnline: A connection test has succeeded, fired even if the connection was already online
  • Offline: The connection has gone from online to offline
  • Online: The connection has gone from offline to online
  • Checking: Whenever we are testing the connection
  • RequestsCapture: A new request is being held (if RemakeRequests flag is set to true)
  • RequestsFlush: Any pending requests have been remade (if RemakeRequests flag is set to true)

    IsOffline

    Checks the current state of the connection, returns true if offline.

    When to use

    When action flows or the user interface need to be aware of the connection status.

    How to use

    Call the client action within action flows to query the connection status. It can also be used as a function in expressions.

    ATTENTION: The action requires the OfflineDetectionEvents block to be present, otherwise the OfflineJS script will not be available and the output will be true (offline) regardless of the actual state.