kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Hooks
  • Getting Started2
  • State7
  • Advanced6
  • Lifecycle16
  • useDebounceEffect
  • useDebounceFn
  • useDeepCompareEffect
  • useDeepCompareLayoutEffect
  • useEffectEvent
  • useEffectWithTarget
  • useInterval
  • useIsHydrated
  • useIsomorphicLayoutEffect
  • useMount
  • useThrottleEffect
  • useThrottleFn
  • useTimeout
  • useUnmount
  • useUpdate
  • useUpdateEffect
  • Browser21
  • Development1
  • Third-Party4
  • Libraries4
  1. Hooks
  2. Lifecycle
  3. useThrottleEffect

useThrottleEffect

PreviousNext

Efek yang dijatah paling sering sekali per jeda.

Tidak ada yang perlu dipasang.

Vue sudah menyediakan padanannya — watch + useThrottleFn. Halaman ini menjelaskan cara memakainya.

ts
import { useThrottleFn } from '@/composables/use-throttle-fn'

const { run } = useThrottleFn(() => savePosition(scrollY.value), 200)
watch(scrollY, run)

Untuk nilai, bukan efek: useThrottle.

Bedanya dengan debounce sering tertukar, jadi disebutkan sekali lagi: debounce menunggu sampai berhenti, throttle tetap jalan tapi dijatah. Untuk pengetikan pakai debounce; untuk scroll dan gerakan penunjuk pakai throttle.

PrevioususeMountNext useThrottleFn

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap