Skip to content
Function

useMap

Reactive Map with set, delete, reset and clear actions.

See useMap with a live demo

@danixsoft/hooks


useMap<K, V>(initialState?): [Omit<Map<K, V>, "set" | "clear" | "delete">, MapActions<K, V>]

Type Parameters

K

K

V

V

Parameters

initialState?

Iterable<readonly [K, V]> = []

Returns

[Omit<Map<K, V>, "set" | "clear" | "delete">, MapActions<K, V>]