UNPKG

tanstack-shadcn-table

Version:

A powerful, feature-rich React table component built on top of TanStack Table v8 with shadcn/ui styling. Optimized bundle size with 55% reduction through peer dependencies.

2 lines (1 loc) 313 B
import{useRef as o,useEffect as t}from"react";function e(e,i,r){const c=o(null),m=o(r),u=o(void 0);t(()=>{m.current=r},[r]),t(()=>(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{u.current!==e&&(u.current=e,m.current(e))},i),()=>{c.current&&clearTimeout(c.current)}),[e,i])}export{e as useDebounce};