Files
NapCatQQ/.pnpm-store/v3/files/b2/55c24e807046f546c8138a5c9fb60b343e824ab229609b7c44824a78adce13703c68572ee2a0546c23fc1f249a879d274534f849eb31bd56fdc8621fec59e0
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

27 lines
465 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 {
throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);
}
}
function mergeRefs(...refs) {
return (node) => {
refs.forEach((ref) => assignRef(ref, node));
};
}
export {
assignRef,
mergeRefs
};