fix: ensure observer is not undefined

This commit is contained in:
Michael Brevard 2024-03-25 19:21:01 +02:00 committed by GitHub
parent 966c17be72
commit f6ba2255e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => {
let unobserve: (() => void) | null = null
onMounted(() => {
const observer = useObserver()
unobserve = observer.observe(el.value as Element, () => {
unobserve = observer!.observe(el.value as Element, () => {
isIntersecting.value = true
unobserve?.()
unobserve = null