Files
litlyx/dashboard/components/ui/table/utils.ts
2025-11-28 16:49:20 +01:00

10 lines
281 B
TypeScript

import type { Updater } from '@tanstack/vue-table'
import type { Ref } from 'vue'
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
ref.value
= typeof updaterOrValue === 'function'
? updaterOrValue(ref.value)
: updaterOrValue
}