useSpringMemo

exactly like useMemo but interpolates computed values between renders using physics based animations

Usage

const [const count: numbercount, const setCount: (value: Kaioken.StateSetter<number>) => voidsetCount] = useState<number>(initial: number | (() => number)): readonly [number, (value: Kaioken.StateSetter<number>) => void]useState(0)
const const springCount: SpringSignal<number>springCount = useSpringMemo<number>(factory: () => number, deps: unknown[], opts?: Partial<SpringOpts>): SpringSignal<number>useSpringMemo(() => const count: numbercount, [const count: numbercount])

Type definition

interface SpringUpdateOpts {
  hard?: any
  soft?: string | number | boolean
}

interface SpringOpts extends SpringUpdateOpts {
  stiffness: number
  damping: number
  precision: number
}