Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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')
```