An open API service indexing awesome lists of open source software.

https://github.com/prolincur/react-idle-interval

Utility to periodically call a callback function and skip when user is idle.
https://github.com/prolincur/react-idle-interval

Last synced: 2 months ago
JSON representation

Utility to periodically call a callback function and skip when user is idle.

Awesome Lists containing this project

README

        

# react-idle-interval
Utility to periodically call a callback function and skip when user is idle.

#### Install
`yarn add react-idle-interval`

#### Usage

```javascript

import { useIdleInterval, useInterval } from 'react-idle-interval'

function MyComponent () {

useIdleInterval({
callback: () => console.log('callback called'),
interval: 100, // ms
idleTimer: 1000, // ms
onIdle: () => console.log('called on idle'),
onActive: () => console.log('called on active'),
})

}

```

### Author

[Prolincur Technologies](https://prolincur.com)