1 import { useState } from 'react';
3 import { useInterval } from './useHandler';
6 * Run current date and update it at the given frequency.
8 export const useNow = (interval: number) => {
9 const [now, setNow] = useState(() => new Date());
10 useInterval(interval, () => setNow(new Date()));