@clementroche/raf
Version:
This package implements a ticker using only one requestAnimationFrame
33 lines (23 loc) • 420 B
Markdown
with yarn
```
yarn add @clementroche/raf
```
```javascript
import RAF from '@clementroche/raf'
const raf = new RAF(60)
raf.add(
'rafID', // id
function ({ time, deltaTime, lagSmoothing }) {
console.log('tick', time, deltaTime, lagSmoothing)
}, // callback
0 // index/priority
)
raf.remove('rafID')
```
First install the npm package
```
npm install @clementroche/raf
```
Or