UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

28 lines (27 loc) 554 B
import * as l from "react"; function s(n, o) { if (typeof n == "function") return n(o); n != null && (n.current = o); } function f(...n) { return (o) => { let u = !1; const c = n.map((t) => { const e = s(t, o); return !u && typeof e == "function" && (u = !0), e; }); if (u) return () => { for (let t = 0; t < c.length; t++) { const e = c[t]; typeof e == "function" ? e() : s(n[t], null); } }; }; } function i(...n) { return l.useCallback(f(...n), n); } export { i as n, f as t };