From f91bfd1567f51747acea2c86ca7d6b82889980e2 Mon Sep 17 00:00:00 2001 From: sgny <28243224+sgny@users.noreply.github.com> Date: Tue, 9 Jul 2019 02:19:56 +0300 Subject: [PATCH] Remove null as instance of netInfoCellularGeneration type --- README.md | 19 ++++++++++++------- package.json | 2 +- src/CommunityNetInfo.re | 3 --- src/CommunityNetInfo.rei | 3 --- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 68249d1..1e9ba95 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,11 @@ Kind of the current network connection. Valid values are: Cellular generation of the current network connection. Valid values are: -| Value | Notes | -| ------- | ----------------------------------------------------------------------------------------------- | -| `null` | Inlined as "null". Returned if the connection is not cellular or its type cannot be determined. | -| `net2g` | Inlined as "2g". Returned for CDMA, EDGE, GPRS and IDEN connections | -| `net3g` | Inlined as "3g". Returned for EHRPD, EVDO, HSPA, HSUPA, HSDPA and UTMS connections. | -| `net4g` | Inlined as "4g". Returned for HSPAP and LTE connections | +| Value | Notes | +| ------- | ----------------------------------------------------------------------------------- | +| `net2g` | Inlined as "2g". Returned for CDMA, EDGE, GPRS and IDEN connections | +| `net3g` | Inlined as "3g". Returned for EHRPD, EVDO, HSPA, HSUPA, HSDPA and UTMS connections. | +| `net4g` | Inlined as "4g". Returned for HSPAP and LTE connections | ### `details` @@ -58,7 +57,13 @@ type netInfoState = { }; ``` -`details` key will have value `Js.Null.empty` (`null`) when `_type` is `null` or `unknown`. `cellularGeneration` key within the `details` object will have value `Js.Null.empty` when `_type` is `wifi`, `bluetooth`, `ethernet`, `wimax`, `vpn` or `other`. Only when `_type` is `cellular`, `cellularGeneration` will be of type `netInfoCellularGeneration`. +`details` key will have value `Js.Null.empty` (`null`) when `_type` is `null` or `unknown`. + +If the `details` objects is not `null`, the `cellularGeneration` key within will + +- have value `Js.Nullable.undefined` when `_type` is `wifi`, `bluetooth`, `ethernet`, `wimax`, `vpn` or `other`. +- have value `Js.Nullable.null` if the connection is not cellular or its generation cannot be determined. +- be of type `netInfoCellularGeneration` only when `_type` is `cellular` and its generation can be determined. ## Methods diff --git a/package.json b/package.json index e8a689a..325e627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reason-react-native-netinfo", - "version": "3.2.3", + "version": "3.2.4", "author": "sgny (https://github.com/sgny)", "repository": "https://github.com/sgny/reason-react-native-netinfo.git", "license": "MIT", diff --git a/src/CommunityNetInfo.re b/src/CommunityNetInfo.re index c029893..94b2e1e 100644 --- a/src/CommunityNetInfo.re +++ b/src/CommunityNetInfo.re @@ -40,9 +40,6 @@ let net3G = "3g"; [@bs.inline] let net4G = "4g"; -[@bs.inline] -let null = "null"; - type details = { . "isConnectionExpensive": bool, diff --git a/src/CommunityNetInfo.rei b/src/CommunityNetInfo.rei index fcd11b5..e5f3fcd 100644 --- a/src/CommunityNetInfo.rei +++ b/src/CommunityNetInfo.rei @@ -40,9 +40,6 @@ let net3G: netInfoCellularGeneration; [@bs.inline "4g"] let net4G: netInfoCellularGeneration; -[@bs.inline "null"] -let null: netInfoCellularGeneration; - type details = { . "isConnectionExpensive": bool,