nubinub / time-hooks

This library provides hooks to efficiently manage timer and other related time logic throughout your applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

time-hooks

This library provides hooks to efficiently manage timer and other related time logic throughout your applications.

NPM JavaScript Style Guide

Install

npm install --save time-hooks

Usage

useTimer

import { useTimer } from 'time-hooks';

// ...
const [timer, start, stop, clear] = useTimer(1000);
// ...

useCountdownTimer

import { useCountdownTimer } from 'time-hooks';

// ...
const [countdown, start, stop, clear, add] = useCountdownTimer(15 * 60 * 1000, 1000);
// ...

License

MIT © nubinub

About

This library provides hooks to efficiently manage timer and other related time logic throughout your applications.

License:MIT License


Languages

Language:JavaScript 88.6%Language:HTML 10.0%Language:CSS 1.4%