Skip to content

API Reference / @gtkx/animated / Globals / AnimatedGlobals

Interface: AnimatedGlobals ​

Properties ​

batchedUpdates? ​

optional batchedUpdates?: (cb) => void

Event props are called with batchedUpdates to reduce extraneous renders

Parameters ​

cb ​

() => void

Returns ​

void


colors? ​

optional colors?: {[key: string]: number; } | null

Provide custom color names for interpolation


createStringInterpolator? ​

optional createStringInterpolator?: (config) => (input) => string

Provide custom logic for string interpolation

Parameters ​

config ​

InterpolatorConfig<string>

Returns ​

(input) => string


frameLoop? ​

optional frameLoop?: "always" | "demand"

sets the global frameLoop setting for the global raf instance


now? ​

optional now?: () => number

Used to measure frame length. Read more here

Returns ​

number


onDemand? ​

optional onDemand?: () => void

Called in demand mode when rafz has frame work pending. Targets that let a host drive the frameloop (e.g. @react-spring/three) wire this to request the next frame so animations don't stall between host-rendered frames.

Returns ​

void


requestAnimationFrame? ​

optional requestAnimationFrame?: (cb) => void

Schedule a function to run on the next frame

Parameters ​

cb ​

() => void

Returns ​

void


skipAnimation? ​

optional skipAnimation?: boolean

Make all animations instant and skip the frameloop entirely


to? ​

optional to?: <Input, Output>(source, args) => FluidValue<Output>

Returns a new Interpolation object

Type Parameters ​

Input ​

Input

Output ​

Output

Parameters ​

source ​

OneOrMore<FluidValue<any, any>>

args ​

InterpolatorArgs<Input, Output>

Returns ​

FluidValue<Output>


willAdvance? ​

optional willAdvance?: (animation) => void

Internal

Exposed for testing purposes

Parameters ​

animation ​

OpaqueAnimation

Returns ​

void