Skip to content

Commit

Permalink
chore: remove redundant stop
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 5, 2022
1 parent cce1bc7 commit 498ea11
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/core/useElementVisibility/index.ts
@@ -1,5 +1,4 @@
import type { MaybeComputedRef } from '@vueuse/shared'
import { tryOnScopeDispose } from '@vueuse/shared'
import { ref, watch } from 'vue-demi'
import type { MaybeComputedElementRef } from '../unrefElement'
import { unrefElement } from '../unrefElement'
Expand Down Expand Up @@ -44,7 +43,7 @@ export function useElementVisibility(
}
}

const stop = watch(
watch(
() => unrefElement(element),
() => testBounding(),
{ immediate: true, flush: 'post' },
Expand All @@ -56,7 +55,5 @@ export function useElementVisibility(
})
}

tryOnScopeDispose(() => stop())

return elementIsVisible
}

0 comments on commit 498ea11

Please sign in to comment.