@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
28 lines • 968 B
TypeScript
import { useListLoader } from '@workday/canvas-kit-react/collection';
/**
* Creates a `Combobox` data loader and a model. The `Combobox` loader extends the
* {@link useListLoader} and connects a {@link ComboboxInput Combobox.Input} to the filter of the
* data loader. A simple loader using
* [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) could look like the
* following:
*
* ```ts
* const {model, loader} = useComboboxLoader(
* {
* total: 0,
* pageSize: 20,
* async load({pageNumber, pageSize, filter}) {
* // `filter` will be a `string`
* return fetch(`/myUrl?filter=${filter}`)
* .then(response => response.json())
* .then(response => {
* return {total: response.total, items: response.items};
* });
* },
* },
* useComboboxModel
* );
* ```
*/
export declare const useComboboxLoader: typeof useListLoader;
//# sourceMappingURL=useComboboxLoader.d.ts.map