/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
//#region src/utils/composeRefs.ts
/**
* Set a given ref to a given value
* This utility takes care of different types of refs: callback refs and RefObject(s)
*/
function setRef(ref, value) {
	if (typeof ref === "function") ref(value);
	else if (ref !== null && ref !== void 0) ref.current = value;
}
/**
* A utility to compose multiple refs together
* Accepts callback refs and RefObject(s)
*/
function composeRefs(...refs) {
	return (node) => refs.forEach((ref) => setRef(ref, node));
}
//#endregion
export { composeRefs };
