Skip to content

hooks/useKeyedValue

import { … } from 'zidane-ui'ui/src/hooks/useKeyedValue.ts

Functions#

useKeyedValueFunction#

The value under key (null when unset or no key), re-rendering only when that key changes.

TypeScript
function useKeyedValue<V>(
  store: KeyedStore<V, unknown>,
  key: string | null | undefined,
): V | null
Type parameters
NameDescription
V
Parameters
NameTypeDescription
storeKeyedStore<V, unknown>

The store to read.

keystring | null | undefined

The key; null / undefined reads nothing.

V | null

ui/src/hooks/useKeyedValue.ts:16