Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/aaronshaf/callbag-animation-frames

Callbag listenable source sending DOMHighResTimeStamp at display refresh rate
https://github.com/aaronshaf/callbag-animation-frames

callbags raf requestionanimationframe

Last synced: 3 months ago
JSON representation

Callbag listenable source sending DOMHighResTimeStamp at display refresh rate

Awesome Lists containing this project

README

        

```bash
yarn add callbag-animation-frames
```

```javascript
const pipe = require("callbag-pipe");
const forEach = require("callbag-for-each");
const animationFrames = require("callbag-animation-frames");

pipe(
animationFrames,
forEach(highResTimeStamp => {
// have fun
})
);
```

If you're blessed with the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator):

```javascript
animationFrames
|> forEach(highResTimeStamp => {
// have fun
});
```

## Learn more

* [Callbag basics](https://github.com/staltz/callbag-basics)
* [Why we need callbags](https://staltz.com/why-we-need-callbags.html), by André Staltz
* [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) (MDN)