react-idle-interval

1.0.0 • Public • Published

react-idle-interval

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

Install

yarn add react-idle-interval

Usage

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

/react-idle-interval/

    Package Sidebar

    Install

    npm i react-idle-interval

    Weekly Downloads

    2

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    85.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • prolincur