mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
13 lines
313 B
TypeScript
13 lines
313 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;
|
|
}
|