AsyncChoices

Source
import { 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 by list and retrieve implement NodeLabeled otherwise it must be provided
  • getValue - this is optional if items returned by list and retrieve implement Identifiable otherwise it must be provided

API

new AsyncChoices(options)

Source

Methods

ParameterTypeDescription
*itemsItemType[]

One of the following:

Choice[]

OR

[string, Choice[]][]
ParameterTypeDescription
*itemItemType
React.ReactNode
ParameterTypeDescription
*valueValueType
React.ReactNode
ParameterTypeDescription
*itemItemType
ValueType
ParameterTypeDescription
*paramsRecord
Promise<ItemType[]>
ParameterTypeDescription
*valueValueType[]|ValueType
depsany
Promise<>
ParameterTypeDescription
*argsany
any
ParameterTypeDescription
*itemsItemType|ItemType[]|null
ItemType|ItemType[]|null
ParameterTypeDescription
*argsany
any

Properties