Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
/ persistent-duration Public archive

WorkerTimers wrapper to count and save duration into localStorage

License

Notifications You must be signed in to change notification settings

dmtrxw/persistent-duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

WorkerTimers wrapper to count and save duration into localStorage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages