ReadOnlyObservableCollection.reduceRight - Andrei15193/react-model-view-viewmodel GitHub Wiki

This method has multiple overloads.


Reduces the collection to a single item iterating the collection from end to start.

public reduceRight(
  callback: (previousItem: TItem, currentItem: TItem, currentIndex: number, collection: this) => TItem
): TItem

Source reference: src/collections/observableCollections/ReadOnlyObservableCollection.ts:451.

Parameters

  • callback: (previousItem:TItem, currentItem:TItem, currentIndex:number, collection:this) => TItem
    The callback that aggregates two items at a time.

Returns: TItem

Returns a single aggregated item.

See also


Reduces the collection to a single item iterating the collection from end to start.

public reduceRight<TResult>(
  callback: (result: TResult, item: TItem, index: number, collection: this) => TResult,
  initialValue: TResult
): TResult

Source reference: src/collections/observableCollections/ReadOnlyObservableCollection.ts:460.

Generic Parameters

  • TResult - The result value type to which items are aggregated.

Parameters

  • callback: (result:TResult, item:TItem, index:number, collection:this) => TResult
    The callback that aggregates one item and the previous value at a time.

  • initialValue: TResult
    The initial value when aggregating the collection.

Returns: TResult

Returns the value containing the aggregated collection.

See also

⚠️ **GitHub.com Fallback** ⚠️