useTimestamp
Reactive current timestamp
Demo
Timestamp: 1718708437866
Usage
js
import { useTimestamp } from '@hungpvq/shared-core';
const timestamp = useTimestamp({ offset: 0 });
js
const { timestamp, pause, resume } = useTimestamp({ controls: true });
Component Usage
vue
<template>
<UseTimestamp v-slot="{ timestamp, pause, resume }">
Current Time: {{ timestamp }}
<button @click="pause()">Pause</button>
<button @click="resume()">Resume</button>
</UseTimestamp>
</template>