import { Ref, nextTick, ref, watch } from 'vue'; export async function toggleTickAsync(tick: Ref, numTimes = 1) { for (let i = 0; i < numTimes; i++) { tick.value = true; await nextTick(); tick.value = false; await nextTick(); } } export function usePulseCount(pulse: Ref) { const pulseCount = ref(0); watch(pulse, (newPulse) => { if (newPulse) pulseCount.value++; }); return { pulseCount }; }