-
Notifications
You must be signed in to change notification settings - Fork 2
ReadOnlyObservableCollection.flatMap
API / ReadOnlyObservableCollection<TItem> / flatMap method
Returns a new JavaScript Array by mapping all items in the collection and the flattening the result by one level.
This is a public method.
public flatMap<TResult>(callback: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => TResult | readonly TResult[]): TResult[]
- TResult: the type to map each item to.
-
callback: Function, the callback mapping each item.
- item: TItem, the item being mapped.
- index: Number, the index of the item being mapped.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
Returns the mapped item(s).Returns: TResult or
readonly
TResult[]
Returns: TResult[]
Returns a mapped and one level flattened Array.
Returns a new JavaScript Array by mapping all items in the collection and the flattening the result by one level.
This is a public method.
public flatMap<TResult, TContext>(callback: (item: TItem, index: number, collection: IReadOnlyObservableCollection<TItem>) => TResult | readonly TResult[], thisArg: TContext): TResult[]
- TResult: the type to map each item to.
- TContext: the context type in which the callback is executed.
-
callback: Function, the callback mapping each item.
- item: TItem, the item being mapped.
- index: Number, the index of the item being mapped.
- collection: IReadOnlyObservableCollection<TItem>, the collection being iterated.
Returns the mapped item(s).Returns: TResult or
readonly
TResult[] - thisArg: TContext, a value to use as context when evaluating items.
Returns: TResult[]
Returns a mapped and one level flattened Array.
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