exactly like useMemo but interpolates computed values between renders using physics based animations
const [const count: number
count, const setCount: (value: Kaioken.StateSetter<number>) => void
setCount] = useState<number>(initial: number | (() => number)): readonly [number, (value: Kaioken.StateSetter<number>) => void]
useState(0)
const const tweenCount: TweenSignal<number>
tweenCount = useTweenMemo<number>(factory: () => number, deps: unknown[], options?: TweenedOptions<number> | undefined): TweenSignal<number>
useTweenMemo(() => const count: number
count, [const count: number
count])
interface TweenedOptions<T> {
delay?: number
duration?: number | ((from: T, to: T) => number)
easing?: (t: number) => number
interpolate?: (a: T, b: T) => (t: number) => T
}