Skip to content

Commit

Permalink
refactor: update
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeghbarati committed Aug 8, 2024
1 parent 9a82d23 commit 75916b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/radix-vue/src/Toast/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useEventListener } from '@vueuse/core'

export const TOAST_SWIPE_START = 'toast.swipeStart'
export const TOAST_SWIPE_MOVE = 'toast.swipeMove'
export const TOAST_SWIPE_CANCEL = 'toast.swipeCancel'
Expand Down Expand Up @@ -32,7 +34,7 @@ export function handleAndDispatchCustomEvent<
detail,
})
if (handler)
currentTarget.addEventListener(name, handler as EventListener, { once: true })
useEventListener(currentTarget, name, handler as EventListener, { once: true })

currentTarget.dispatchEvent(event)
}
Expand Down

0 comments on commit 75916b4

Please sign in to comment.