From 139f9945dfdc37bd37709cfbdf3f54a72a056bdb Mon Sep 17 00:00:00 2001 From: Martin Konicek Date: Wed, 9 Dec 2015 14:51:43 -0800 Subject: [PATCH] Don't use arrow functions with Flow types to fix website generation Summary: Our custom jsdocs parser doesn't support the syntax yet. public Reviewed By: bestander Differential Revision: D2739861 fb-gh-sync-id: eefc3c54b98e06597ca7d93396aa4fe3a92d4a58 --- Examples/UIExplorer/NetInfoExample.js | 2 +- Libraries/Network/NetInfo.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Examples/UIExplorer/NetInfoExample.js b/Examples/UIExplorer/NetInfoExample.js index af120c591..a79ed67e2 100644 --- a/Examples/UIExplorer/NetInfoExample.js +++ b/Examples/UIExplorer/NetInfoExample.js @@ -176,7 +176,7 @@ exports.examples = [ { platform: 'android', title: 'NetInfo.isConnectionExpensive (Android)', - description: 'Asycnronously check isConnectionExpensive', + description: 'Asynchronously check isConnectionExpensive', render(): ReactElement { return ; } }, ]; diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index d4295754f..fff16c598 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -58,11 +58,15 @@ const _subscriptions = new Map(); let _isConnected; if (Platform.OS === 'ios') { - _isConnected = (reachability: ReachabilityStateIOS): bool => { + _isConnected = function( + reachability: ReachabilityStateIOS, + ): bool { return reachability !== 'none' && reachability !== 'unknown'; }; } else if (Platform.OS === 'android') { - _isConnected = (connectionType: ConnectivityStateAndroid) : bool => { + _isConnected = function( + connectionType: ConnectivityStateAndroid, + ): bool { return connectionType !== 'NONE' && connectionType !== 'UNKNOWN'; }; }