use-idle
hook for detecting when a user is idle (wrapper around activity-detector)
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.