chore: revert for code style

This commit is contained in:
tbitw2549 2024-06-14 20:23:40 +03:00
parent 068d40a283
commit fa0bdc0e5b
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export function useIntersectionObserver (options?: Partial<IntersectionObserverI
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0 const isVisible = entry.isIntersecting || entry.intersectionRatio > 0
if (isVisible && callback) { callback() } if (isVisible && callback) { callback() }
} }
}, defu(options ?? {}, { root: null, rootMargin: '0px', threshold: 0 })) }, defu(options, { root: null, rootMargin: '0px', threshold: 0 }))
} }
callbacks.set(element, callback) callbacks.set(element, callback)
observer.observe(element) observer.observe(element)

View File

@ -37,7 +37,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => {
if (!isIntersecting.value) { if (!isIntersecting.value) {
onMounted(() => { onMounted(() => {
const observer = useIntersectionObserver(attrs.loader ?? {}) const observer = useIntersectionObserver(attrs.loader as Partial<IntersectionObserverInit> | undefined)
unobserve = observer!.observe(el.value as Element, () => { unobserve = observer!.observe(el.value as Element, () => {
isIntersecting.value = true isIntersecting.value = true
unobserve?.() unobserve?.()