1.0.3 • Published 2 years ago

persistent-duration v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago