useGlide
Returns where a derived state is gliding: from the live step's latest change to now.
@internote/canvas-sdk/reactOn this page
import { useGlide } from '@internote/canvas-sdk/react';deriveAt is evaluated once per change, against a runtime read just before it fired, and memoised on that moment and deps; the environment blends from and to by t however its state blends. The host's frame loop runs while t is under 1.
#Signature
<T, Ctx>(
runtime: EnvironmentAnimationRuntime<Ctx>,
to: T,
deriveAt: (runtime: EnvironmentAnimationRuntime<Ctx>) => T,
deps: DependencyList,
options: GlideOptions,
): Glide<T>#Parameters
runtimeThe environment's runtime,
ctx.animation.toThe state now, as the environment derives it at this render.
deriveAtThe same derivation, against a runtime read at another moment. Pure.
depsWhat else the derivation reads, which re-derives the start when it changes.
optionsHow long the glide takes, and whether to glide at all.
Declared in packages/canvas-sdk/src/react/use-glide.ts:63.