0.9.4 • Published 2 years ago

@dh-react-hooks/use-raf v0.9.4

Weekly downloads
2
License
ISC
Repository
github
Last release
2 years ago

@dh-react-hooks/use-raf

NPM version codecov

react hooks for handling requestAnimationFrame

Installation

npm i @dh-react-hooks/use-raf

Arguments

propstyperequireddefaultdescription
disablebooleanfalsefalsedisable to call requestAnimationFrame at the first time
durationnumberfalseundefinedduration time to call requestAnimationFrame in milliseconed. it not specify, callback will loop infinitely
callbackfunctiontrueundefinedcallback function to requestAnimationFrame

Way to Ride

  • Common jS
const useRaf = require('@dh-react-hooks/use-raf')

  const { isActive, start, stop } = useRaf.default({
    disable,
    duration,
    callback
  })
  • ESM
import useRaf from '@dh-react-hooks/use-raf'
  
  const { isActive, start, stop } = useRaf({
    disable,
    duration,
    callback
  })
0.9.4

2 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.4.0

6 years ago