Callbag listenable source sending DOMHighResTimeStamp at display refresh rate
npm install callbag-animation-frames``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:
`javascript``
animationFrames
|> forEach(highResTimeStamp => {
// have fun
});
* Callbag basics
* Why we need callbags, by André Staltz
* requestAnimationFrame (MDN)