Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clementroche/raf
A ticker implementation using only one requestAnimationFrame
https://github.com/clementroche/raf
clock raf ticker time
Last synced: about 1 month ago
JSON representation
A ticker implementation using only one requestAnimationFrame
- Host: GitHub
- URL: https://github.com/clementroche/raf
- Owner: clementroche
- Created: 2020-08-27T10:54:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-31T08:17:29.000Z (over 4 years ago)
- Last Synced: 2024-10-12T19:23:13.178Z (2 months ago)
- Topics: clock, raf, ticker, time
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@clementroche/raf
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# raf
## Install
First install the npm package
```
npm install @clementroche/raf
```Or with yarn
```
yarn add @clementroche/raf
```## Usage
```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')
```