src/sync-client.js
function(callback) {
      var online = true;

      // first, check if navigator.online is available
      if(typeof navigator.onLine !== "undefined"){
        online = navigator.onLine;
      }

      // second, check if Phonegap is available and has online info
      if(online){
        //use phonegap to determin if the network is available
        if(typeof navigator.network !== "undefined" && typeof navigator.network.connection !== "undefined"){
          var networkType = navigator.network.connection.type;
          if(networkType === "none" || networkType === null) {
            online = false;
          }
        }
      }

      return callback(online);
    }
function(callback) {
      var online = true;

      // first, check if navigator.online is available
      if(typeof navigator.onLine !== "undefined"){
        online = navigator.onLine;
      }

      // second, check if Phonegap is available and has online info
      if(online){
        //use phonegap to determin if the network is available
        if(typeof navigator.network !== "undefined" && typeof navigator.network.connection !== "undefined"){
          var networkType = navigator.network.connection.type;
          if(networkType === "none" || networkType === null) {
            online = false;
          }
        }
      }

      return callback(online);
    }
function ( callback ) { var online = true ; // first, check if navigator.online is available if ( typeof navigator . onLine !== "undefined" ) { online = navigator . onLine ; } // second, check if Phonegap is available and has online info if ( online ) { //use phonegap to determin if the network is available if ( typeof navigator . network !== "undefined" && typeof navigator . network . connection !== "undefined" ) { var networkType = navigator . network . connection . type ; if ( networkType === "none" || networkType === null ) { online = false ; } } } return callback ( online ) ; }
PRIVATE FUNCTIONS 
Check if client is online.
Function is used to stop sync from executing requests.
PRIVATE FUNCTIONS Check if client is online . Function is used to stop sync from executing requests .