Skip to content

useRafFn

Category
Last Changed
8月1日16时40分

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

v4.1.0 on 8/1/2025
bc8f2 - feat: add useStorage

Released under the MIT License.