1import type { Updater } from '@tanstack/vue-table' 2import type { Ref } from 'vue' 3 4export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) { 5 ref.value 6 = typeof updaterOrValue === 'function' 7 ? updaterOrValue(ref.value) 8 : updaterOrValue 9}