IReadOnlyObservableCollection.filter - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / IReadOnlyObservableCollection<TItem> / filter method
This method has multiple overloads.
Creates a new JavaScript Array containing only the items the satisfy the given collection.
filter<TContext>(
predicate: (this: TContext, item: TItem, index: number, collection: this) => boolean,
thisArg?: TContext
): TItem[]
Source reference: src/collections/observableCollections/IReadOnlyObservableCollection.ts:194
.
- TContext - The context type in which the callback is executed.
-
predicate: (this:TContext, item:TItem, index:
number
, collection:this
) =>boolean
The callback indicating which items to add in the result Array. -
thisArg: TContext
A value to use as context when evaluating items.
A new Array containing the items for which the provided predicate
evaluated to true
.
Creates a new JavaScript Array containing only the items the satisfy the given collection.
filter<TResult, TContext>(
predicate: (this: TContext, item: TItem, index: number, collection: this) => item is TResult,
thisArg?: TContext
): TResult[]
Source reference: src/collections/observableCollections/IReadOnlyObservableCollection.ts:204
.
-
TResult - The type to convert each item to.
-
TContext - The context type in which the callback is executed.
-
predicate: (this:TContext, item:TItem, index:
number
, collection:this
) =>item
is TResult
The callback indicating which items to add in the result Array. -
thisArg: TContext
A value to use as context when evaluating items.
A new Array containing the items for which the provided predicate
evaluated to true
.