@ariakit/react-core
Version:
Ariakit React core
26 lines (23 loc) • 633 B
JavaScript
"use client";
import {
useStore,
useStoreProps
} from "./RTNCFSKZ.js";
import {
useUpdateEffect
} from "./5GGHRIN3.js";
// src/collection/collection-store.ts
import * as Core from "@ariakit/core/collection/collection-store";
function useCollectionStoreProps(store, update, props) {
useUpdateEffect(update, [props.store]);
useStoreProps(store, props, "items", "setItems");
return store;
}
function useCollectionStore(props = {}) {
const [store, update] = useStore(Core.createCollectionStore, props);
return useCollectionStoreProps(store, update, props);
}
export {
useCollectionStoreProps,
useCollectionStore
};