Simple timer using React Context API. Can be accesible from any component.
npm install @layerhub-io/use-timerSimple timer using React Context API. Can be accesible from any component.
``sh`
npm i @layerhub-io/use-timer
Using pnpm:
`sh`
pnpm i @layerhub-io/use-timer
Wrap you application with TimerProvider, then use it from anywhere your application.
`tsx
import { TimerProvider, useTimer } from '@layerhub-io/use-timer';
const ParentApp = () => {
return (
);
};
const App = () => {
const { start, time, pause, reset, setTime } = useTimer();
return (