AppState
Types
type t = [#active | #background | #inactive | #unknown | #extension]
Values
AppState.currentState // t
AppState.isAvailable // bool
Methods
addEventListener
addEventListener: [
| #change(t => unit)
| #focus(unit => unit)
| #blur(unit => unit)
| #memoryWarning(unit => unit)
] => EventSubscription.t
React.useEffect0(() => {
let sub = AppState.addEventListener(#change(next => Console.log(next)))
Some(() => sub->EventSubscription.remove)
})