useStableMemo
API
import useStableMemo from '@restart/hooks/useStableMemo'
useStableMemo
<T>(factory: () => T, deps?: DependencyList) => TIdentical to
useMemo
except that it provides a semantic guarantee that values will not be invalidated unless the dependencies change. This is unlike the built inuseMemo
which may discard memoized values for performance reasons.Parameters
factory
() => TA function that returns a value to be memoized
deps?
DependencyListA dependency array
Return Value T