IReadOnlyObservableCollection.find - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / IReadOnlyObservableCollection<TItem> / find method
This method has multiple overloads.
Returns the first item that satisfies the given condition.
find<TContext>(
predicate: (this: TContext, item: TItem, index: number, collection: this) => boolean,
thisArg?: TContext
): undefined | TItem
Source reference: src/collections/observableCollections/IReadOnlyObservableCollection.ts:135
.
- TContext - The context type in which the callback is executed.
-
predicate: (this:TContext, item:TItem, index:
number
, collection:this
) =>boolean
The callback performing the check. -
thisArg: TContext
A value to use as context when evaluating items.
Returns: undefined
| TItem
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.
Returns the first item that satisfies the given condition.
find<TResult, TContext>(
predicate: (this: TContext, item: TItem, index: number, collection: this) => item is TResult,
thisArg?: TContext
): undefined | TResult
Source reference: src/collections/observableCollections/IReadOnlyObservableCollection.ts:145
.
-
TResult - The type of item to return.
-
TContext - The context type in which the callback is executed.
-
predicate: (this:TContext, item:TItem, index:
number
, collection:this
) =>item
is TResult
The callback performing the check. -
thisArg: TContext
A value to use as context when evaluating items.
Returns: undefined
| TResult
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.