Skip to content

Commit

Permalink
Adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommezz committed Jun 11, 2018
1 parent 856cbda commit 0cd2467
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/checkInternetConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
import { Platform, NetInfo } from 'react-native';
import checkInternetAccess from './checkInternetAccess';

// on iOS, the listener is fired immediately after registration
// on Android, we need to use `isConnected.fetch`, that returns a promise which resolves with a boolean
/**
* Utility that allows to query for internet connectivity on demand
* On iOS, the listener is fired immediately after registration
* On Android, we need to use `isConnected.fetch`, that returns a promise which resolves with a boolean
* @param timeout
* @param url
* @returns {Promise<boolean>}
*/
export default function checkInternetConnection(
timeout: number = 3000,
url: string = 'http://www.google.com/',
Expand Down

0 comments on commit 0cd2467

Please sign in to comment.