Function useSet

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

    Type Parameters

    • Value

    Parameters

    • Optional initialState: StateInitializer<Iterable<Value>>

      Iterable or function that returns an iterable of items

    Returns readonly [Set<Value>, {
        add: ((item) => void);
        clear: (() => void);
        remove: ((item) => void);
        replace: ((values) => void);
        toggle: ((item) => void);
    }]

    tuple with the Set and an object with immutable update handlers add/remove/clear

Generated using TypeDoc