-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Mux video component #242
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/basement/next-typescript/86wDyVTS7Vx5sP6uiMXxj3mPnFui |
setInView(() => { | ||
return element.isIntersecting | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setInView(() => { | |
return element.isIntersecting | |
}) | |
setInView(element.isIntersecting) |
if (options.triggerOnce) { | ||
observer.unobserve(elm as unknown as Element) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE. por las dudas, probaste q esto funcione bien y no triggeree re-renders?
if (options.triggerOnce) { | ||
observer.unobserve(elm as unknown as Element) | ||
} | ||
cb(element) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ejecutamos el callback solo cuando isIntersecting === true
? no se si es medio rari.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, si, hacía sentido en mi caso de uso pero mejor le pasamos el evento completo al cb y que haga lo que necesite con ese valor
@matiasperz Otra cosita: acá me gustaría que devuelva directamente el boolean, tipo Nos pasó en MrBeast q habíamos asumido q devolvía directamente el |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying feedback, yes... one year after
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Updates on
mux-video.tsx
:Updates on
use-intersection-observer.ts
: