Function useMap

  • State preconfigured to do everything you could want with a Map.

    Type Parameters

    • Key extends string

    • Value

    Parameters

    • Optional initialState: StateInitializer<Record<Key, Value>>

      Object or function that returns an object

    Returns readonly [Map<Key, Value>, {
        clear: (() => void);
        delete: ((key) => void);
        replace: ((value) => void);
        set: ((key, value) => void);
    }]

    tuple with the Map and an object with immutable update handlers set/delete/clear

Generated using TypeDoc