WIP jordan

This commit is contained in:
Jordan Weingarten
2026-04-16 11:11:44 -05:00
parent ff2d7b18b5
commit 67482f6629
163 changed files with 50627 additions and 728 deletions

18
app/utils/refDebounced.ts Normal file
View File

@@ -0,0 +1,18 @@
import { ref, watch, type Ref } from 'vue'
/** Debounced mirror of a ref (no @vueuse dependency). */
export function refDebounced<T>(source: Ref<T>, ms: number): Ref<T> {
const debounced = ref(source.value) as Ref<T>
let timer: ReturnType<typeof setTimeout> | undefined
watch(
source,
(v) => {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
debounced.value = v
}, ms)
},
{ flush: 'sync' }
)
return debounced
}