# @and-cru/use-foreground

> React Native hook to call handler function when app is in foreground

Latest version **1.0.0** (published 2021-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @and-cru/use-foreground
pnpm add @and-cru/use-foreground
yarn add @and-cru/use-foreground
bun add @and-cru/use-foreground
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-02-01 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tiaan du Plessis |
| Maintainers | tiaanduplessis, pedreviljoen |
| Keywords | react-native, react, hook, foreground, appstate |

## Links

- npm: https://www.npmjs.com/package/@and-cru/use-foreground
- Repository: https://github.com/and-cru/use-foreground
- Homepage: https://github.com/and-cru/use-foreground#readme
- Issues: https://github.com/and-cru/use-foreground/issues
- npm.io page: https://npm.io/package/@and-cru/use-foreground

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-02-01

## README

# @and-cru/use-foreground
[![package version](https://img.shields.io/npm/v/@and-cru/use-foreground.svg?style=flat-square)](https://npmjs.org/package/@and-cru/use-foreground)
[![package downloads](https://img.shields.io/npm/dm/@and-cru/use-foreground.svg?style=flat-square)](https://npmjs.org/package/@and-cru/use-foreground)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/npm/l/@and-cru/use-foreground.svg?style=flat-square)](https://npmjs.org/package/@and-cru/use-foreground)
[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

> React Native hook to call handler function when app is in foreground

## Table of Contents

- [Usage](#usage)
- [Install](#install)
- [Contribute](#contribute)
- [License](#License)

## Usage

```js
import useForeground from '@and-cru/use-foreground'

export const Example = () => {
  useForeground(() => {
    console.log('refreshing state...')
  })

  return null
}

```


## Install

This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com). 

```sh
$ npm install @and-cru/use-foreground
$ # OR
$ yarn add @and-cru/use-foreground
```

## Contribute

1. Fork it and create your feature branch: `git checkout -b my-new-feature`
2. Commit your changes: `git commit -am "Add some feature"`
3. Push to the branch: `git push origin my-new-feature`
4. Submit a pull request

## License

MIT

---
_Source: https://npm.io/package/@and-cru/use-foreground · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
