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()

Readme

Keywords

none

Package Sidebar

Install

npm i persistent-duration

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

4.23 kB

Total Files

7

Last publish

Collaborators

  • dmtrxw