Skip to content

Commit c2435d3

Browse files
committed
ReScript
1 parent 8eb261f commit c2435d3

12 files changed

+309
-337
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
13-
#*.bs.js # we do want this files to ensure zero-cost
12+
# ReScript artifacts
13+
# *.bs.js # we do want this files to ensure zero-cost
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog of `@reason-react-native/netinfo`
1+
# Changelog of `@rescript-react-native/netinfo`
22

33
## 5.9.1 - 2020-11-17
44

@@ -28,21 +28,21 @@ rescript 8.2 compat
2828
### Breaking Changes
2929

3030
- Moved from
31-
[sgny/reason-react-native-netinfo](https://github.com/sgny/reason-react-native-netinfo#readme).
32-
`npm` package was previously named `reason-react-native-netinfo`. Please
31+
[sgny/rescript-react-native-netinfo](https://github.com/sgny/rescript-react-native-netinfo#readme).
32+
`npm` package was previously named `rescript-react-native-netinfo`. Please
3333
update your dependencies accordingly. You may update your existing code using
34-
the `NetInfo` module of `reason-react-native` by replacing references to the
34+
the `NetInfo` module of `rescript-react-native` by replacing references to the
3535
`ReactNative.NetInfo` module with `ReactNativeNetInfo.Legacy`. However, do
3636
note that the new API is more straightforward.
3737

3838
- The module is renamed to `ReactNativeNetInfo` (previously`CommunityNetInfo`).
3939

4040
- Releases require use of [jetifier](https://github.com/mikehardy/jetifier) for
4141
versions 0.59.x of React Native. You may continue to use
42-
[`reason-react-native-netinfo`](https://www.npmjs.com/package/reason-react-native-netinfo)
42+
[`rescript-react-native-netinfo`](https://www.npmjs.com/package/rescript-react-native-netinfo)
4343
version 3.2.x if you do not wish to use `jetifier`.
4444

4545
## 3.x
4646

4747
See
48-
[sgny/reason-react-native-netinfo](https://github.com/sgny/reason-react-native-netinfo/tree/3.2.4])
48+
[sgny/rescript-react-native-netinfo](https://github.com/sgny/rescript-react-native-netinfo/tree/3.2.4])

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native contributors
3+
Copyright (c) 2019 @rescript-react-native contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# `@reason-react-native/netinfo`
1+
# `@rescript-react-native/netinfo`
22

3-
[![Build Status](https://github.com/reason-react-native/netinfo/workflows/Build/badge.svg)](https://github.com/reason-react-native/netinfo/actions)
4-
[![Version](https://img.shields.io/npm/v/@reason-react-native/netinfo.svg)](https://www.npmjs.com/@reason-react-native/netinfo)
5-
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
3+
[![Build Status](https://github.com/rescript-react-native/netinfo/workflows/Build/badge.svg)](https://github.com/rescript-react-native/netinfo/actions)
4+
[![Version](https://img.shields.io/npm/v/@rescript-react-native/netinfo.svg)](https://www.npmjs.com/@rescript-react-native/netinfo)
5+
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)
66

7-
[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
7+
[ReScript](https://rescript-lang.org) bindings for
88
[`@react-native-community/netinfo`](https://github.com/react-native-netinfo/react-native-netinfo).
99

1010
Exposed as `ReactNativeNetInfo` module.
1111

12-
`@reason-react-native/netinfo` X.y.\* means it's compatible with
12+
`@rescript-react-native/netinfo` X.y.\* means it's compatible with
1313
`@react-native-community/netinfo` X.y.\*
1414

1515
## Installation
@@ -20,22 +20,22 @@ is properly installed & configured by following their installation instructions,
2020
you can install the bindings:
2121

2222
```console
23-
npm install @reason-react-native/netinfo
23+
npm install @rescript-react-native/netinfo
2424
# or
25-
yarn add @reason-react-native/netinfo
25+
yarn add @rescript-react-native/netinfo
2626
```
2727

28-
`@reason-react-native/netinfo` should be added to `bs-dependencies` in your
28+
`@rescript-react-native/netinfo` should be added to `bs-dependencies` in your
2929
`bsconfig.json`:
3030

3131
```diff
3232
{
3333
//...
3434
"bs-dependencies": [
35-
"reason-react",
36-
"reason-react-native",
35+
"@rescript/react",
36+
"rescript-react-native",
3737
// ...
38-
+ "@reason-react-native/netinfo"
38+
+ "@rescript-react-native/netinfo"
3939
],
4040
//...
4141
}
@@ -86,7 +86,7 @@ Cellular generation of the current network connection. Valid values are:
8686

8787
#### `netInfoState`
8888

89-
```reason
89+
```rescript
9090
type netInfoState = {
9191
.
9292
"_type": netInfoStateType,
@@ -112,7 +112,7 @@ type netInfoState = {
112112
`details` depends on `_type` given within [`netInfoState`](#netInfoState). If
113113
`_type` is not `null` or `unknown`, `details` is an object as below:
114114

115-
```reason
115+
```rescript
116116
type details = {
117117
.
118118
"isConnectionExpensive": bool,
@@ -158,7 +158,7 @@ Note that some keys may only exist in the JS object when `_type` is `wifi` or
158158

159159
#### `configure`
160160

161-
```reason
161+
```rescript
162162
configure: netInfoConfiguration => unit
163163
```
164164

@@ -167,14 +167,14 @@ configure: netInfoConfiguration => unit
167167
To query state of the active connection, returns `netInfoState` wrapped in a
168168
`Promise`.
169169

170-
```reason
170+
```rescript
171171
fetch: unit => Js.Promise.t(netInfoState)
172172
```
173173

174174
Below example demonstrates determination of the cellular connection generation,
175175
using this method.
176176

177-
```reason
177+
```rescript
178178
React.useEffect0(() => {
179179
Js.Promise.(
180180
ReactNativeNetInfo.fetch()
@@ -216,7 +216,7 @@ React.useEffect0(() => {
216216

217217
To query the connection state for a particular interface.
218218

219-
```reason
219+
```rescript
220220
fetchInterface: [ | `cellular | `ethernet | `wifi] => Js.Promise.t(netInfoState)
221221
```
222222

@@ -227,19 +227,19 @@ To subscribe to the connection state; accepts a listener of type
227227
The listener will be called once following subscription and each time connection
228228
state changes.
229229

230-
```reason
230+
```rescript
231231
addEventListener: (netInfoState => unit) => t
232232
```
233233

234234
where
235235

236-
```reason
236+
```rescript
237237
type t = unit => unit
238238
```
239239

240240
Below example demonstrates subscribing to changes in connection state:
241241

242-
```reason
242+
```rescript
243243
React.useEffect0(() => {
244244
let remove =
245245
ReactNativeNetInfo.addEventListener(w =>
@@ -277,13 +277,13 @@ React.useEffect0(() => {
277277

278278
This method returns a React Hook with type `netInfoState`
279279

280-
```reason
280+
```rescript
281281
useNetInfo: unit => netInfoState
282282
```
283283

284284
Below example demonstrates its use within a `Text` component:
285285

286-
```reason
286+
```rescript
287287
<Text>
288288
(
289289
switch (ReactNativeNetInfo.useNetInfo()##details->Js.Null.toOption) {
@@ -324,11 +324,11 @@ releases.
324324
## Contribute
325325

326326
Read the
327-
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
327+
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
328328
before contributing.
329329

330330
## Code of Conduct
331331

332332
We want this community to be friendly and respectful to each other. Please read
333-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
333+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
334334
so that you can understand what actions will and will not be tolerated.

bsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "@reason-react-native/netinfo",
3-
"refmt": 3,
4-
"reason": {
5-
"react-jsx": 3
6-
},
2+
"name": "@rescript-react-native/netinfo",
3+
"reason": { "react-jsx": 3 },
74
"package-specs": {
85
"module": "commonjs",
96
"in-source": true

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@reason-react-native/netinfo",
2+
"name": "@rescript-react-native/netinfo",
33
"description": "ReScript bindings for @react-native-community/netinfo.",
44
"version": "5.9.1",
55
"publishConfig": {
@@ -8,20 +8,18 @@
88
"peerDependencies": {
99
"@react-native-community/netinfo": "^5.9.0"
1010
},
11-
"repository": "https://github.com/reason-react-native/netinfo.git",
11+
"repository": "https://github.com/rescript-react-native/netinfo.git",
1212
"author": "sgny (https://github.com/sgny)",
1313
"license": "MIT",
1414
"keywords": [
1515
"rescript",
16-
"reason",
17-
"reasonml",
18-
"bucklescript",
1916
"react-native"
2017
],
2118
"files": [
2219
"*.md",
2320
"bsconfig.json",
24-
"src/**/*.re",
21+
"src/**/*.res",
22+
"src/**/*.resi",
2523
"src/**/*.js",
2624
"!src/**/*.bs.js"
2725
],
@@ -38,7 +36,7 @@
3836
"release": "npmpub"
3937
},
4038
"devDependencies": {
41-
"bs-platform": "^8.2.0",
39+
"bs-platform": "^9.0.0",
4240
"husky": "^4.0.0",
4341
"lint-staged": "^10.0.0",
4442
"npm-run-all": "^3.0.0",

0 commit comments

Comments
 (0)