Skip to content

Commit d7dffdb

Browse files
committed
Revert "All addEventListener should returns EventSubscription.t"
This reverts commit bac7fd5. Closes #408
1 parent bac7fd5 commit d7dffdb

8 files changed

Lines changed: 21 additions & 13 deletions

File tree

‎reason-react-native/src/apis/AppState.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ external currentState: t = "";
2222
[@bs.scope "AppState"] [@bs.module "react-native"]
2323
external addEventListener:
2424
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
25-
unit =
25+
EventSubscription.t =
2626
"";
2727
2828
[@bs.scope "AppState"] [@bs.module "react-native"]

‎reason-react-native/src/apis/AppState.re‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ external currentState: t = "";
1515
[@bs.scope "AppState"] [@bs.module "react-native"]
1616
external addEventListener:
1717
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
18-
unit =
18+
EventSubscription.t =
1919
"";
2020

2121
[@bs.scope "AppState"] [@bs.module "react-native"]

‎reason-react-native/src/apis/AppState.rei‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ external currentState: t = "";
1515
[@bs.scope "AppState"] [@bs.module "react-native"]
1616
external addEventListener:
1717
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
18-
unit =
18+
EventSubscription.t =
1919
"";
2020

2121
[@bs.scope "AppState"] [@bs.module "react-native"]

‎reason-react-native/src/apis/BackHandler.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ wip: true
55
---
66

77
```reason
8+
type remove = {. "remove": unit => unit};
9+
810
[@bs.scope "BackHandler"] [@bs.module "react-native"]
911
external exitApp: unit => unit = "";
1012
1113
[@bs.scope "BackHandler"] [@bs.module "react-native"]
1214
external addEventListener:
13-
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) =>
14-
EventSubscription.t =
15+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => remove =
1516
"";
1617
1718
[@bs.scope "BackHandler"] [@bs.module "react-native"]

‎reason-react-native/src/apis/BackHandler.re‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
type remove = {. "remove": unit => unit};
2+
13
[@bs.scope "BackHandler"] [@bs.module "react-native"]
24
external exitApp: unit => unit = "";
35

46
[@bs.scope "BackHandler"] [@bs.module "react-native"]
57
external addEventListener:
6-
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) =>
7-
EventSubscription.t =
8+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => remove =
89
"";
910

1011
[@bs.scope "BackHandler"] [@bs.module "react-native"]

‎reason-react-native/src/apis/NetInfo.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ type info = {
4949
"effectiveType": EffectiveConnectionType.t,
5050
};
5151
52+
type remove = {. "remove": unit => unit};
53+
5254
[@bs.module "react-native"] [@bs.scope "NetInfo"]
5355
external addEventListener:
54-
([@bs.string] [ | `connectionChange], info => unit) => EventSubscription.t =
56+
([@bs.string] [ | `connectionChange], info => unit) => remove =
5557
"";
5658
5759
[@bs.module "react-native"] [@bs.scope "NetInfo"]
@@ -68,7 +70,7 @@ external getConnectionInfo: unit => Js.Promise.t(info) = "";
6870
module IsConnected = {
6971
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]
7072
external addEventListener:
71-
([@bs.string] [ | `connectionChange], bool => unit) => EventSubscription.t =
73+
([@bs.string] [ | `connectionChange], bool => unit) => remove =
7274
"";
7375
7476
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]

‎reason-react-native/src/apis/NetInfo.re‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ type info = {
4242
"effectiveType": EffectiveConnectionType.t,
4343
};
4444

45+
type remove = {. "remove": unit => unit};
46+
4547
[@bs.module "react-native"] [@bs.scope "NetInfo"]
4648
external addEventListener:
47-
([@bs.string] [ | `connectionChange], info => unit) => EventSubscription.t =
49+
([@bs.string] [ | `connectionChange], info => unit) => remove =
4850
"";
4951

5052
[@bs.module "react-native"] [@bs.scope "NetInfo"]
@@ -61,7 +63,7 @@ external getConnectionInfo: unit => Js.Promise.t(info) = "";
6163
module IsConnected = {
6264
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]
6365
external addEventListener:
64-
([@bs.string] [ | `connectionChange], bool => unit) => EventSubscription.t =
66+
([@bs.string] [ | `connectionChange], bool => unit) => remove =
6567
"";
6668

6769
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]

‎reason-react-native/src/apis/NetInfo.rei‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ type info = {
4242
"_type": ConnectionType.t,
4343
};
4444

45+
type remove = {. "remove": unit => unit};
46+
4547
[@bs.module "react-native"] [@bs.scope "NetInfo"]
4648
external addEventListener:
47-
([@bs.string] [ | `connectionChange], info => unit) => EventSubscription.t =
49+
([@bs.string] [ | `connectionChange], info => unit) => remove =
4850
"";
4951

5052
[@bs.module "react-native"] [@bs.scope "NetInfo"]
@@ -61,7 +63,7 @@ external getConnectionInfo: unit => Js.Promise.t(info) = "";
6163
module IsConnected: {
6264
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]
6365
external addEventListener:
64-
([@bs.string] [ | `connectionChange], bool => unit) => EventSubscription.t =
66+
([@bs.string] [ | `connectionChange], bool => unit) => remove =
6567
"";
6668

6769
[@bs.module "react-native"] [@bs.scope ("NetInfo", "isConnected")]

0 commit comments

Comments
 (0)