useStepRevision

Re-renders the calling component on every step change and on each animation frame for a while after it.

@internote/canvas-sdk/hostHook
On this page
import { useStepRevision } from '@internote/canvas-sdk/host';

The revision it returns bumps on every step transition and keeps bumping on animation frames for tailMs after each transition and after mount, so duration: keyframe transitions and compound time offsets resolve smoothly on screen. The tail is a bound, not a schedule: a host whose choreography runs longer calls pulse to restart it, as CanvasSceneView does while a runtime reports pending time work.

#Signature

(steps: StepController, options?: StepRevisionOptions): {
    revision: number;
    step: number;
    pulse: () => void;
}

#Parameters

steps
The scene's step controller.
options
How long the tail runs.

#Returns

The revision to pass down, the current step, and pulse to restart the tail.

Declared in packages/canvas-sdk/src/host/use-step-revision.ts:38.

Last updated