use-idle

1.0.0 • Public • Published

use-idle

hook for detecting when a user is idle (wrapper around activity-detector)

NPM JavaScript Style Guide

Install

npm install --save use-idle

Usage

import React from "react";
import { useIdle } from "use-idle";

const Example = () => {
  const isIdle = useIdle();
  useEffect(() => {
    isIdle && alert("You've gone idle!");
  }, [isIdle]);

  return <div>Don't move a damn muscle.</div>;
};

License

MIT © @mayteio


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i use-idle

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

13.4 kB

Total Files

14

Last publish

Collaborators

  • harelpls