StringTune/Docs

API Reference

StringFPS

Internal requestAnimationFrame loop wrapper with optional FPS limiting.

StringFPS

StringFPS is the internal loop wrapper used to drive frame updates.

Public status

StringFPS lives in src/utils, but it is not exported by the package root. Treat it as internal runtime reference.

What it does

It wraps requestAnimationFrame and can:

  • run uncapped
  • run at a target FPS
  • invoke a callback on each accepted frame
  • stop and restart the loop

Main methods

  • start(fps)
  • stop()
  • setOnFrame(callback)
  • destructor()

Important behavior

  • fps = 0 means uncapped
  • non-zero FPS uses an internal interval gate
  • the class contains visibility handling logic, but in the current code the document visibility listener is commented out

Runtime role

StringTune uses StringFPS for the main update loop that drives:

  • cursor updates
  • scroll controller updates
  • module lifecycle dispatch
  • frameDOM flushes

Practical note

Useful as runtime reference. Not something to document as a mainstream package integration symbol.