a
File size: 304 Bytes
2c8ae4e
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import type { Updater } from "@tanstack/vue-table"

import type { Ref } from "vue"
import { isFunction } from "@tanstack/vue-table"

export function valueUpdater<T>(updaterOrValue: Updater<T>, ref: Ref<T>) {
  ref.value = isFunction(updaterOrValue)
    ? updaterOrValue(ref.value)
    : updaterOrValue
}