1.0.0 • Published 5 years ago

use-idle v1.0.0

Weekly downloads
12
License
MIT
Repository
-
Last release
5 years ago

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.

1.0.0

5 years ago