UNPKG

react-code-view

Version:
17 lines (16 loc) 418 B
"use strict"; exports.__esModule = true; exports["default"] = mergeRefs; var toFnRef = function toFnRef(ref) { return !ref || typeof ref === 'function' ? ref : function (value) { ref.current = value; }; }; function mergeRefs(refA, refB) { var a = toFnRef(refA); var b = toFnRef(refB); return function (value) { if (typeof a === 'function') a(value); if (typeof b === 'function') b(value); }; }