@tamalweb/use-time-ago

1.0.0 • Public • Published

@tamal3053/use-time-ago

React hook for time since current time in readable format. React Time Ago Custom Hook.

Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.

You'll need to install react, react-dom, etc at ^16.7.0-alpha.0

Install

yarn add tamal3053/use-time-ago

Usage

import useTimeAgo from 'tamal3053/use-time-ago';

function MyComponent() {
  return useTimeAgo( new Date() - 360000 ); // 6 minutes ago
}

Package Sidebar

Install

npm i @tamalweb/use-time-ago

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.77 kB

Total Files

4

Last publish

Collaborators

  • tamalweb