@pranitdeshpande98/useappidle_hook
v1.0.2
Published
`@pranitdeshpande98/useappidle_hook` is a custom React hook designed to detect when the user becomes idle by not interacting with the application for a specified period of time. It provides a seamless way to manage user idle states in React applications.
Downloads
3
Readme
@pranitdeshpande98/useappidle_hook
Introduction
@pranitdeshpande98/useappidle_hook
is a custom React hook designed to detect when the user becomes idle by not interacting with the application for a specified period of time. It provides a seamless way to manage user idle states in React applications.
Installation
You can install @pranitdeshpande98/useappidle_hook
via npm or yarn:
npm install @pranitdeshpande98/useappidle_hook
or
yarn add @pranitdeshpande98/useappidle_hook
Usage
To use the @pranitdeshpande98/useappidle_hook in your React components, import it and invoke it with the desired timeout value (in milliseconds).
The hook returns a boolean value indicating whether the user is currently idle.
Parameters
timeout: The timeout value in milliseconds. After the specified time of inactivity, the user will be considered idle.
Example
You can find a simple example of how to use @pranitdeshpande98/useappidle_hook in the example directory of this repository.
License
This project is licensed under the MIT License.