ixfx
    Preparing search index...

    Function itemsWithEnd

    • Yields every item in eventsByEnd that has the specified end value. Return item is a wrapped object consisting of the event as well as its index.

      The function expects that the input array has been sorted using sortByEnd, and therefore sorted by ascending end value.

      const events = [ { start: 1, end: 2}, { start: 5, end: 10 }, { start: 10, end: 12 }];
      const matched = [...itemsWithEnd(events, 10)];
      // matched is [{ event: { start: 5, end: 10 }, index: 1 }]

      Parameters

      • eventsByEnd: Readonly<{ end: number; start: number }>[]

        Events sorted with sortByEnd

      • end: number

        End position

      Returns Generator<Readonly<{ event: EventItem; index: number }>>