Function toMap

  • Converts an async-iterable to a map with a key selector and options for an element selector and cancellation.

    Type Parameters

    • TSource

      The type of elements in the source collection.

    • TKey

      The type of key used for the map.

    • TElement = TSource

      The type of element to use for the map.

    Parameters

    • source: Iterable<TSource>

      The source collection to turn into a map.

    • options: ToMapOptions<TSource, TKey, TElement>

      The options for getting the key and element for the map.

    Returns Map<TKey, TElement | TSource>

    A map containing the key and elements from the selector functions.

Generated using TypeDoc