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

No recent changes

Released under the MIT License.