ConnectivityService

App.ConnectivityService. ConnectivityService

Responsible for managing offline/ online status

Constructor

new ConnectivityService()

Example
App.connectivityService.on(
 App.ConnectivityService.Events.STATUS_CHANGE,
 function(offline) { console.log(offline); })
);

Methods

isOffline() → {boolean}

Utility method to indicate connectivity status

Returns:

true if offline

Type
boolean

isOnline() → {boolean}

Utility method to indicate connectivity status

Returns:

true if online

Type
boolean

off(event, handler)

Remove a subscription.

Parameters:
Name Type Description
event String

Event to remove subscription from

handler function

Callback to remove

on(event, handler)

See:

Subscribe to an event.

Parameters:
Name Type Description
event String

Event to subscribe to

handler function

Callback function