JSPM

@tamalweb/use-time-ago

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q38676F
  • License MIT

React hook to get time ago or time since current time (time ago).

Package Exports

  • @tamalweb/use-time-ago

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tamalweb/use-time-ago) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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
}