Skip to content

Commit 30f510f

Browse files
sgnycknitt
authored andcommitted
BackHandler event name as variant, update addEventListener type signature (#426)
1 parent 4d90e30 commit 30f510f

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ 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"]
12-
external addEventListener: (string, unit => bool) => EventSubscription.t = "";
14+
external addEventListener:
15+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => remove =
16+
"";
1317
1418
[@bs.scope "BackHandler"] [@bs.module "react-native"]
15-
external removeEventListener: (string, unit => bool) => unit = "";
19+
external removeEventListener:
20+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => unit =
21+
"";
1622
1723
```
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
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"]
5-
external addEventListener: (string, unit => bool) => EventSubscription.t = "";
7+
external addEventListener:
8+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => remove =
9+
"";
610

711
[@bs.scope "BackHandler"] [@bs.module "react-native"]
8-
external removeEventListener: (string, unit => bool) => unit = "";
12+
external removeEventListener:
13+
([@bs.string] [ | `backPress | `hardwareBackPress], unit => bool) => unit =
14+
"";

0 commit comments

Comments
 (0)