use_callback
Memoize a function identity between renders.
Parameters:
- fn (Callable[P, R]) - A function to memoize.
- dependencies (Sequence[Any] | None, default:
None) - Values the function depends on. If absent, thefnpassed on each render is returned as is. If empty, thefnfrom the first render is kept. Otherwise, it is replaced only when one of the dependencies has changed.
Returns:
- Callable[P, R] - The memoized function. The same function object is returned on every render until it is replaced.