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