-
Notifications
You must be signed in to change notification settings - Fork 2
ReadOnlyObservableCollection.find
API / ReadOnlyObservableCollection<TItem> / find method
Returns the first item for which the provided predicate
evaluated to true
, if no item can be found then undefined
is returned.
This is a public method.
public find(predicate: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => boolean): TItem | undefined
-
predicate: Function, the callback performing the item check.
- item: TItem, the item being evaluated.
- index: Number, the index of the item being evaluated.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
ReturnsReturns: Boolean
true
if the provided item satisfies the condition;false
otherwise.
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.
Returns the first item for which the provided predicate
evaluated to true
, if no item can be found then undefined
is returned.
This is a public method.
public find<TContext>(predicate: (this: TContext, item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => boolean, thisArg: TContext): TItem | undefined
- TContext: the context type in which the callback is executed.
-
predicate: Function, the callback performing the item check.
- item: TItem, the item being evaluated.
- index: Number, the index of the item being evaluated.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
ReturnsReturns: Boolean
true
if the provided item satisfies the condition;false
otherwise. - thisArg: TContext, a value to use as context when checking items.
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.
Returns the first item for which the provided predicate
evaluated to true
, if no item can be found then undefined
is returned.
This is a public method.
public find<TResult extends TItem>(predicate: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => item is TResult): TResult | undefined
-
TResult: the type of item to find.
Must extend TItem.
-
predicate: Function, the callback performing the item check.
- item: TItem, the item being evaluated.
- index: Number, the index of the item being evaluated.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
ReturnsReturns: Boolean
true
if the provided item satisfies the condition;false
otherwise.
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.
Returns the first item for which the provided predicate
evaluated to true
, if no item can be found then undefined
is returned.
This is a public method.
public find<TResult extends TItem, TContext>(predicate: (this: TContext, item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => item is TResult, thisArg: TContext): TResult | undefined
-
TResult: the type of item to find.
Must extend TItem. - TContext: the context type in which the callback is executed.
-
predicate: Function, the callback performing the item check.
- item: TItem, the item being evaluated.
- index: Number, the index of the item being evaluated.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
ReturnsReturns: Boolean
true
if the provided item satisfies the condition;false
otherwise. - thisArg: TContext, a value to use as context when checking items.
Returns the first item for which the provided predicate
evaluates to true
; otherwise undefined
.
Motivation
Overview
Guides and Tutorials - Getting Started
Releases
API
Events
IEvent
IEventHandler
INotifyPropertiesChanged
INotifyCollectionChanged
IItemAddedEventArgs
IItemRemovedEventArgs
ICollectionChange
ItemRemovedCallback
ICollectionChange
EventDispatcher
Observable Collections
IReadOnlyObservableCollection
IObservableCollection
ReadOnlyObservableCollection
ObservableCollection
ViewModels
ViewModel
isViewModel
Forms
IFormFieldViewModel
IFormFieldViewModelConfig
FormFieldViewModel
FormFieldCollectionViewModel
FormFieldSet
DynamicFormFieldCollectionViewModel
Validation
IReadOnlyValidatable
IValidatable
IValidationConfig
ValidatorCallback
CollectionItemValidatorCallback
ValidatableSelectorCallback
ValidationConfigSelectorCallback
UnsubscribeCallback
registerValidators
registerCollectionValidators
registerCollectionItemValidators
React Hooks
EventHandler
useEvent
ViewModelType
ViewModelFactory
useViewModel
useViewModelMemo
useObservableCollection
useValidators
useCollectionValidators
useCollectionItemValidators