mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-31 04:07:56 +01:00
chore(useTimer): pass options to useTimestamp
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
import { ref, computed } from 'vue-demi'
|
import { ref, computed } from 'vue-demi'
|
||||||
import { useTimestamp } from '@vueuse/core'
|
import { useTimestamp } from '@vueuse/core'
|
||||||
|
import type { UseTimestampOptions } from '@vueuse/core'
|
||||||
|
|
||||||
export function useTimer (cb: (...args: unknown[]) => any, interval: number) {
|
export function useTimer (cb: (...args: unknown[]) => any, interval: number, options: UseTimestampOptions<true> = { controls: true }) {
|
||||||
let timer: number | null = null
|
let timer: number | null = null
|
||||||
const timestamp = useTimestamp({ controls: true })
|
const timestamp = useTimestamp(options)
|
||||||
const startTime = ref<number | null>(null)
|
const startTime = ref<number | null>(null)
|
||||||
|
|
||||||
const remaining = computed(() => {
|
const remaining = computed(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user