Skip to content
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

fix(useIntersectionObserver)!: rename type IntersectionObserverOptions to UseIntersectionObserverOptions #1870

Merged
merged 1 commit into from Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/directive.test.ts
Expand Up @@ -3,7 +3,7 @@ import type { VueWrapper } from '@vue/test-utils'
import { mount } from '@vue/test-utils'

import { vIntersectionObserver } from './directive'
import type { IntersectionObserverOptions } from '.'
import type { UseIntersectionObserverOptions } from '.'

const App = defineComponent({
props: {
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('vIntersectionObserver', () => {
describe('given options', () => {
beforeEach(() => {
onIntersectionObserver = vi.fn()
const options: IntersectionObserverOptions = {
const options: UseIntersectionObserverOptions = {
rootMargin: '10px',
}
wrapper = mount(App, {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/directive.ts
@@ -1,11 +1,11 @@
import { directiveHooks } from '@vueuse/shared'
import type { ObjectDirective } from 'vue-demi'
import { useIntersectionObserver } from '.'
import type { IntersectionObserverOptions } from '.'
import type { UseIntersectionObserverOptions } from '.'

type BindingValueFunction = IntersectionObserverCallback

type BindingValueArray = [BindingValueFunction, IntersectionObserverOptions]
type BindingValueArray = [BindingValueFunction, UseIntersectionObserverOptions]

export const vIntersectionObserver: ObjectDirective<
HTMLElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/useIntersectionObserver/index.ts
Expand Up @@ -6,7 +6,7 @@ import type { MaybeElementRef } from '../unrefElement'
import { unrefElement } from '../unrefElement'
import { useSupported } from '../useSupported'

export interface IntersectionObserverOptions extends ConfigurableWindow {
export interface UseIntersectionObserverOptions extends ConfigurableWindow {
/**
* The Element or Document whose bounds are used as the bounding box when testing for intersection.
*/
Expand Down Expand Up @@ -34,7 +34,7 @@ export interface IntersectionObserverOptions extends ConfigurableWindow {
export function useIntersectionObserver(
target: MaybeElementRef,
callback: IntersectionObserverCallback,
options: IntersectionObserverOptions = {},
options: UseIntersectionObserverOptions = {},
) {
const {
root,
Expand Down