| 1 | import type { RefObject } from "react"; |
| 2 | |
| 3 | /** Ref attachment occurs before command publication and is never an async command. */ |
| 4 | export function composeDomRef<Node>(attach: (node: Node | null) => void, ref: RefObject<Node | null>) { |
| 5 | return (node: Node | null) => { |
| 6 | attach(node); |
| 7 | ref.current = node; |
| 8 | }; |
| 9 | } |
| 10 |