yarn add callbag-animation-frames
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:
animationFrames
|> forEach(highResTimeStamp => {
// have fun
});
- Callbag basics
- Why we need callbags, by André Staltz
- requestAnimationFrame (MDN)