persistent-duration

1.0.3 • Public • Published

persistent-duration

WorkerTimers wrapper to count and save duration into localStorage

Installation

npm install --save persistent-duration

Usage

import * as duration from 'persistent-duration'

// Set an interval on worker, func will increment the duration every 1000ms
const intervalId = duration.start()

// Stop the interval.
// Keep in mind that duration still persists even though
// you have stopped the interval
duration.stop(intervalId)

// Get duration (returns a number)
duration.get()

// Remove duration from localStorage
duration.clear()

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    10
  • 1.0.2
    1

Package Sidebar

Install

npm i persistent-duration

Weekly Downloads

11

Version

1.0.3

License

MIT

Unpacked Size

4.23 kB

Total Files

7

Last publish

Collaborators

  • dmtrxw