Spaces:
Paused
Paused
Download web/src/components/ui/table/utils.ts from stremio-db/a: direct link, hf CLI and curl.
- Browser
- Download file 304 Bytes
-
https://huggingface.co/spaces/stremio-db/a/resolve/main/web/src/components/ui/table/utils.ts
- Command line
-
hf download hf://spaces/stremio-db/a/web/src/components/ui/table/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/stremio-db/a/resolve/main/web/src/components/ui/table/utils.ts
304 Bytes
| 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 | |
| } | |