ui-ingredients
Version:
Headless component library for Svelte powered by zag
8 lines (7 loc) • 320 B
JavaScript
import { TreeCollection } from '@zag-js/collection';
import { reflect } from '@zag-js/svelte';
import { isFunction } from 'es-toolkit';
export function createTreeCollection(options) {
const collection = $derived(new TreeCollection(isFunction(options) ? options() : options));
return reflect(() => collection);
}