| f0687f82 | 09-Aug-2019 |
Robert L <[email protected]> |
[device/cellular/network] Expose enums
Why ---
The `enums` defined in the `expo-cellular`, `expo-device`, and `expo-network` were not exposed to the end user.
For example, if a developer wanted to
[device/cellular/network] Expose enums
Why ---
The `enums` defined in the `expo-cellular`, `expo-device`, and `expo-network` were not exposed to the end user.
For example, if a developer wanted to check if a their device type was a `DESKTOP`, which has an enum value of `3` as defined in our `enum`, they would have to do the following:
```js const deviceType = Device.getDeviceTypeAsync();
// check if device is a desktop if (deviceType === 3) { ... ```
as opposed to:
```js const deviceType = Device.getDeviceTypeAsync();
// check if device is a desktop if (deviceType === Device.DeviceType.DESKTOP) { ... ```
This PR fixes this issue by exposing the enums defined in `expo-cellular`, `expo-device`, and `expo-network`.
show more ...
|