ixfx
    Preparing search index...

    Function arrayFromItems

    • Converts a collection of IndexedEventItem back into an array of EventItem, placing items at their original index.

      // Get all items that start at position 5
      const itemsAtPosition = [...itemsWithStart(sortedEvents, 5)];

      // Make this into an array:
      const items = arrayFromItems(itemsAtPosition);

      By default, the index field is used to construct the array. If ignoreIndexes is set to true, the the returned array is constructed in the order of the input items, ignoring the index field. This can be useful if you just want to extract the events from a generator without caring about their original position.

      Parameters

      • items: Iterable<Readonly<{ event: EventItem; index: number }>>
      • ignoreIndexes: boolean = false

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

      EventItems