Module: siteKiosk.system.network

This module provides means to react to changes in the network connectivity, you can easily attach listeners to this kind of event.

Example

// notify when the connectivity changes
    siteKiosk.system.network.onConnectivityChanged(function(connected) {
         console.log("Your connectivity changed, let's hope for the best...");
         if(connected) {
             console.log("Phew, internet is back.");
         } else {
             console.log("Terrific, internet is gone.");
         }
    });

Methods

<static> onConnectivityChanged(callback) → {siteKiosk.system.network~eventSubscription}

Fires when the network connectivity has been changed.
Parameters:
Name Type Description
callback siteKiosk.system.network~connectivityChangedCallback A callback being invoked when connectivity changes
Returns:
A handler to unsubscribe the event
Type
siteKiosk.system.network~eventSubscription

Type Definitions

connectivityChangedCallback(connected)

This callback is being invoked when network connectivity changes.
Parameters:
Name Type Description
connected boolean Whether the device is currently connected to the internet

eventSubscription

An event subscription, used to unsubscribe the event.
Type:
  • Object
Properties:
Name Type Description
unbind function A function to unsubscribe the event