use-persistent-stopwatch
A Vue composable bringing storage persisted stopwatches to your apps compatible with Vue 2 & 3.
✨ Features
- Multiple instances referenced by a key.
- Persistence through sessions and tabs using storage.
- Pausable/resumable.
- Fully typed with TypeScript.
- Compatible with Vue 2 and 3 (thanks to vue-demi).
? Prerequisites
- Vue 2: you need the Composition API plugin installed (>=1.1.0).
- Vue 3: you don't need anything else than Vue (>=3.2.0).
⚙️ Installing
For Yarn users:
For Npm users:
? Usage
Basic usage
Simply import the composable and call it in your setup()
function:
Multiple stopwatches
You can create multiple independent stopwatches by using different keys: