Documentation / @ripl/core / FrameBuffer
Interface: FrameBuffer() ​
Defined in: packages/core/src/animation/utilities.ts:14
A debounced requestAnimationFrame scheduler. Calling it schedules a callback for the next frame, replacing any frame already pending, so a burst of calls within one frame collapses into a single callback.
FrameBuffer(
callback):void
Defined in: packages/core/src/animation/utilities.ts:19
Schedules a callback for the next animation frame, cancelling any frame already pending.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
callback | AnyFunction | The function to run on the next frame. |
Returns ​
void
Methods ​
cancel() ​
cancel():
void
Defined in: packages/core/src/animation/utilities.ts:24
Cancels the pending frame, if any, without scheduling a replacement. Call this on teardown so work scheduled by the last interaction cannot run against a destroyed target.
Returns ​
void