rafFnStore

Call function on every requestAnimationFrame. With controls of pausing and resuming.

Demo

0

Usage

<script lang="ts">
import { rafFnStore } from "svelte-legos";

let counter = 0;

function handler() {
  counter += 1;
}

const { pause, resume } = rafFnStore(handler);

</script>