mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-22 12:11:53 +02:00
2 lines
395 B
JavaScript
2 lines
395 B
JavaScript
|
import{useRef as l,useEffect as i}from"react";import{useEvent as r}from'./use-event.js';let u=Symbol();function T(t,n=!0){return Object.assign(t,{[u]:n})}function y(...t){let n=l(t);i(()=>{n.current=t},[t]);let c=r(e=>{for(let o of n.current)o!=null&&(typeof o=="function"?o(e):o.current=e)});return t.every(e=>e==null||(e==null?void 0:e[u]))?void 0:c}export{T as optionalRef,y as useSyncRefs};
|