UI kit reference
hooks/useLatest
import { … } from 'zidane-ui'ui/src/hooks/useLatest.ts
Functions#
useLatestFunction#
A stable function returning value as of the last commit, for what is built once (a store, a palette
source, a listener) and reads the current value when it runs. Never call it during render.
function useLatest<T>(value: T): () => TType parameters
| Name | Description |
|---|---|
| T |
Parameters
| Name | Type | Description |
|---|---|---|
| value | T | What the function returns. |
Returns
() => TThe same function for the component's life.