AsyncChoices
Sourceimport { AsyncChoices } from "@prestojs/viewmodel";
Default implementation for AsyncChoicesInterface
All options can be customised via options
.
You must provide list
and retrieve
- everything else can be optional with the following restrictions:
getLabel
- this is optional if items returned bylist
andretrieve
implement NodeLabeled otherwise it must be providedgetValue
- this is optional if items returned bylist
andretrieve
implement Identifiable otherwise it must be provided
API
Constructor
new AsyncChoices(options)
SourceMethods
getChoices(items)
SourceParameter | Type | Description | |
---|---|---|---|
* | items | ItemType[] |
Returns
One of the following:
Choice[]OR
[string, Choice[]][]retrieve(value,?deps)
SourceParameter | Type | Description | |
---|---|---|---|
* | value | ValueType[]|ValueType | |
deps | any |
Returns
useResolveItems(items)
SourceParameter | Type | Description | |
---|---|---|---|
* | items | ItemType|ItemType[]|null |
Returns