AsyncChoices

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

API

Constructor

new AsyncChoices(options)

Arguments:

ArgumentTypeDescription
*
options
An object with the properties below
...any
Any properties from AsyncChoicesInterface

Methods

getChoices(items)

Arguments:

ArgumentTypeDescription
*itemsItemType[]
Returns:(|[string, []])[]
getLabel(item)

Arguments:

ArgumentTypeDescription
*itemItemType
Returns:ReactNode
getMissingLabel(value)

Arguments:

ArgumentTypeDescription
*valueValueType
Returns:ReactNode
getValue(item)

Arguments:

ArgumentTypeDescription
*itemItemType
Returns:ValueType
list(params)

Arguments:

ArgumentTypeDescription
*paramsRecord
Returns:Promise
parseValue(value)

Arguments:

ArgumentTypeDescription
*valueany
Returns:any
retrieve(value,?deps)

Arguments:

ArgumentTypeDescription
*valueValueType|ValueType[]
depsany
Returns:Promise
useListProps(args)

Arguments:

ArgumentTypeDescription
*argsany
Returns:any
useResolveItems<T>(items)

Arguments:

ArgumentTypeDescription
*itemsT
Returns:T
useRetrieveProps(args)

Arguments:

ArgumentTypeDescription
*argsany
Returns:any

Properties

multiple

Source
boolean

options

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