@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
13 lines (12 loc) • 491 B
JavaScript
import { cleanProps } from "../../utils/clean-props.js";
import { computed, toValue } from "vue";
import { useMachine } from "@zag-js/vue";
import * as asyncList from "@zag-js/async-list";
//#region src/components/collection/use-async-list.ts
var useAsyncList = (props = {}) => {
const context = computed(() => cleanProps(toValue(props)));
const service = useMachine(asyncList.machine, context);
return computed(() => asyncList.connect(service));
};
//#endregion
export { useAsyncList };