universal-appstate
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

universal-appstate npm

Obtain application becoming foreground or background

Supported

weex

Installation

npm install --save universal-appstate

Usage

import AppState from 'universal-appstate';
 
console.log(AppState.isAvailable);
console.log(AppState.currentState); // active|background
 
const _handleAppStateChange = (nextAppState) => {
  console.log(nextAppState); // active|background
}
 
AppState.addEventListener('change', _handleAppStateChange);
AppState.removeEventListener('change', _handleAppStateChange);

APIS

isAvailable: boolean

Whether to support.

nextAppState: 'active' | 'background'

Application becoming foreground or background.

Readme

Keywords

Package Sidebar

Install

npm i universal-appstate

Weekly Downloads

0

Version

0.7.0

License

BSD-3-Clause

Unpacked Size

9.3 kB

Total Files

12

Last publish

Collaborators

  • rax-publisher
  • wintercn
  • yuanyan
  • zeroling