Skip to content

useObservableMap

github-actions[bot] edited this page Dec 3, 2024 · 3 revisions
API / useObservableMap hook

Watches an observable map for changes. The map is the only hook dependency.

function useObservableMap<TObservableMap extends undefined | null | INotifyMapChanged<TKey, TItem>, TKey, TItem>(
  observableMap: TObservableMap
): TObservableMap

Source reference: src/hooks/UseObservableMap.ts:12.

Generic Parameters

  • TObservableMap - The observable map type.

    Type constraints: undefined | null | INotifyMapChanged<TKey, TItem>.

  • TKey - The type of keys the map contains.

  • TItem - The type of items the map contains.

Parameters

  • observableMap: TObservableMap
    The map to watch.

Returns: TObservableMap

Returns the provided observable map.

Clone this wiki locally