Type alias Mapper<Element, NewElement>

Mapper<Element, NewElement>: ((element, index) => NewElement | Promise<NewElement>)

Type Parameters

  • Element = unknown

    Source element type

  • NewElement = unknown

    Element type returned by the mapper

Type declaration

    • (element, index): NewElement | Promise<NewElement>
    • Function which is called for every item in input. Expected to return a Promise or value.

      Parameters

      • element: Element

        Iterated element

      • index: number

        Index of the element in the source array

      Returns NewElement | Promise<NewElement>

Generated using TypeDoc