Skip to content

useRafFn

Category
Last Changed
3月7日6时51分

Call function on every requestAnimationFrame. With controls of pausing and resuming.

Demo

Frames: 0
Delta: 0ms
FPS Limit: 60

Usage

js
import { useRafFn } from 'comuse-core'
import { ref } from 'vue'

const count = ref(0)

const { pause, resume } = useRafFn(() => {
  count.value++
  console.log(count.value)
})

Source

SourceDemoDocs

Changelog

v3.2.2 on 1/23/2025
301cc - feat: core function support refValue
v3.1.0 on 1/9/2025
49422 - feat: add useThrottle and useDebounce function
049f7 - feat: animation md
v3.0.0 on 1/7/2025
825ca - feat: shared add functions animation, ease, gesture

Released under the MIT License.