Effection Logo
@effectionx/rafv1.0.0-alpha.0thefrontside/effection-contrib
JSR BadgeNPM Badge with published versionBundle size badgeDependency count badgeTree shaking support badge
import { } from "@effectionx/raf"

RAF: Request Animation Frame

Subscribe to a stream of Request Animation Frame updates.

import { each, main, suspend } from "effection";
import { raf } from "@effectionx/raf";

await main(function* () {
  for (const timestamp of yield* each(raf)) {
    // add your handler code here
    console.log(timestamp);
    yield* each.next();
  }
});

API Reference

const raf: Stream<number, never>

A stream that produces animation frames.

Type

Stream<number, never>