Guest User

Untitled

a guest
Apr 21st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. NetInfo.getConnectionInfo().then((connectionInfo) => {
  2. console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
  3. });
  4. function handleFirstConnectivityChange(connectionInfo) {
  5. console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
  6. NetInfo.removeEventListener(
  7. 'connectionChange',
  8. handleFirstConnectivityChange
  9. );
  10. }
  11. NetInfo.addEventListener(
  12. 'connectionChange',
  13. handleFirstConnectivityChange
  14. );
Add Comment
Please, Sign In to add comment