import { getHookedComponent } from "./prehook" ; /**
 * TODO : DOC
 * TODO : Type
 */ export function useRef ( ) { let nodes = [ ] ; let multi = false ; getHookedComponent ( ) . addEffect ( { unmount : ( ) => nodes = null } ) ; return function ( r ? ) { if ( ! nodes ) return ; const typeofFirst = typeof r ; if ( typeofFirst === 'string' || typeofFirst === 'number' ) { multi = true ; return function ( rr ) { if ( ! nodes ) return ; if ( rr == null ) { delete nodes [ r ] ; nodes . length -- ; return ; } nodes . length ++ ; nodes [ r ] = rr ; } ; } else if ( r != null ) { nodes [ 0 ] = r ; } else return ( multi ? nodes : nodes [ 0 ] ) ; } ; }