Skip to content

Commit 3e4a914

Browse files
cknittsgny
authored andcommitted
Fix AppState bindings. (#568)
1 parent 1be8431 commit 3e4a914

File tree

3 files changed

+57
-9
lines changed

3 files changed

+57
-9
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,29 @@ external currentState: t = "";
2121
2222
[@bs.scope "AppState"] [@bs.module "react-native"]
2323
external addEventListener:
24-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
25-
EventSubscription.t =
24+
(
25+
[@bs.string]
26+
[
27+
| `change(t => unit)
28+
| `focus(unit => unit)
29+
| `blur(unit => unit)
30+
| `memoryWarning(unit => unit)
31+
]
32+
) =>
33+
unit =
2634
"";
2735
2836
[@bs.scope "AppState"] [@bs.module "react-native"]
2937
external removeEventListener:
30-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
38+
(
39+
[@bs.string]
40+
[
41+
| `change(t => unit)
42+
| `focus(unit => unit)
43+
| `blur(unit => unit)
44+
| `memoryWarning(unit => unit)
45+
]
46+
) =>
3147
unit =
3248
"";
3349

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,28 @@ external currentState: t = "";
1414

1515
[@bs.scope "AppState"] [@bs.module "react-native"]
1616
external addEventListener:
17-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
18-
EventSubscription.t =
17+
(
18+
[@bs.string]
19+
[
20+
| `change(t => unit)
21+
| `focus(unit => unit)
22+
| `blur(unit => unit)
23+
| `memoryWarning(unit => unit)
24+
]
25+
) =>
26+
unit =
1927
"";
2028

2129
[@bs.scope "AppState"] [@bs.module "react-native"]
2230
external removeEventListener:
23-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
31+
(
32+
[@bs.string]
33+
[
34+
| `change(t => unit)
35+
| `focus(unit => unit)
36+
| `blur(unit => unit)
37+
| `memoryWarning(unit => unit)
38+
]
39+
) =>
2440
unit =
2541
"";

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,28 @@ external currentState: t = "";
1414

1515
[@bs.scope "AppState"] [@bs.module "react-native"]
1616
external addEventListener:
17-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
18-
EventSubscription.t =
17+
(
18+
[@bs.string]
19+
[
20+
| `change(t => unit)
21+
| `focus(unit => unit)
22+
| `blur(unit => unit)
23+
| `memoryWarning(unit => unit)
24+
]
25+
) =>
26+
unit =
1927
"";
2028

2129
[@bs.scope "AppState"] [@bs.module "react-native"]
2230
external removeEventListener:
23-
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
31+
(
32+
[@bs.string]
33+
[
34+
| `change(t => unit)
35+
| `focus(unit => unit)
36+
| `blur(unit => unit)
37+
| `memoryWarning(unit => unit)
38+
]
39+
) =>
2440
unit =
2541
"";

0 commit comments

Comments
 (0)