AsyncChoices

Source
import { AsyncChoices } from "@prestojs/viewmodel";
AsyncChoices<ItemType,ValueType>

API

Constructor

new AsyncChoices(options)
Params:
ParameterTypeDescription
*
options
An object with the properties below
...any
Any properties from AsyncChoicesInterface

Methods

getChoices(items)
Params:
ParameterTypeDescription
*itemsItemType[]
Returns:(|[string, []])[]
getLabel(item)
Params:
ParameterTypeDescription
*itemItemType
Returns:ReactNode
getMissingLabel(value)
Params:
ParameterTypeDescription
*valueValueType
Returns:ReactNode
getValue(item)
Params:
ParameterTypeDescription
*itemItemType
Returns:ValueType
list(params)
Params:
ParameterTypeDescription
*paramsRecord
Returns:Promise
retrieve(value,?deps)
Params:
ParameterTypeDescription
*valueValueType|ValueType[]
depsany
Returns:Promise
useListProps(args)
Params:
ParameterTypeDescription
*argsany
Returns:any
useResolveItems<T>(items)
Params:
ParameterTypeDescription
*itemsT
Returns:T
useRetrieveProps(args)
Params:
ParameterTypeDescription
*argsany
Returns:any

Properties

multiple

Source
boolean

options

Source
An object with these properties:
PropertyTypeDescription
...any
Any properties from AsyncChoicesInterface