UNPKG

@mojito-inc/secondary-market

Version:

Mojito secondary market is the platform to purchase NFT.

2 lines (1 loc) 318 B
import{useState as e,useEffect as r}from"react";const t=({threshold:t=0,elementRef:n})=>{const[s,o]=e(!1);return r((()=>{const e=new IntersectionObserver((([e])=>{o(e.isIntersecting)}),{threshold:t}),r=n&&n.current;return r&&e.observe(r),()=>{r&&e.unobserve(r)}}),[n,t]),{inView:s,elementRef:n}};export{t as default};