Skip to content

Commit 789cfa4

Browse files
committed
bs-react-native-next: add AppState.
1 parent 6e73727 commit 789cfa4

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

‎bs-react-native-next/src/apis/AppState.bs.js‎

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type t;
2+
3+
external fromString: string => t = "%identity";
4+
5+
let active = "active"->fromString;
6+
let background = "background"->fromString;
7+
let inactive = "inactive"->fromString;
8+
9+
[@bs.scope "AppState"] [@bs.module "react-native"]
10+
external currentState: t = "currentState";
11+
12+
[@bs.scope "AppState"] [@bs.module "react-native"]
13+
external addEventListener: (string, unit => unit) => EventSubscription.t = "";
14+
15+
[@bs.scope "AppState"] [@bs.module "react-native"]
16+
external removeEventListener: (string, unit => unit) => unit = "";

0 commit comments

Comments
 (0)