Files
NapCatQQ/.pnpm-store/v3/files/9a/13c4cc6fb12d8f9b8532764c357b712b889d9f3537f5a8cf931df43492d5ea68c1da0065813d7f7b846281f568bb5364b907fc2effd3ab0835a04921c67738
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

28 lines
477 B
Plaintext

"use client";
// src/refs.ts
import { isFunction } from "@heroui/shared-utils";
function assignRef(ref, value) {
if (ref == null)
return;
if (isFunction(ref)) {
ref(value);
return;
}
try {
ref.current = value;
} catch (error) {
throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);
}
}
function mergeRefs(...refs) {
return (node) => {
refs.forEach((ref) => assignRef(ref, node));
};
}
export {
assignRef,
mergeRefs
};