UNPKG

@ariakit/react-core

Version:

Ariakit React core

25 lines (15 loc) 1.14 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } var _25BPIGZHcjs = require('./25BPIGZH.cjs'); var _OZM4QA2Vcjs = require('./OZM4QA2V.cjs'); // src/collection/collection-store.ts var _collectionstore = require('@ariakit/core/collection/collection-store'); var Core = _interopRequireWildcard(_collectionstore); function useCollectionStoreProps(store, update, props) { _OZM4QA2Vcjs.useUpdateEffect.call(void 0, update, [props.store]); _25BPIGZHcjs.useStoreProps.call(void 0, store, props, "items", "setItems"); return store; } function useCollectionStore(props = {}) { const [store, update] = _25BPIGZHcjs.useStore.call(void 0, Core.createCollectionStore, props); return useCollectionStoreProps(store, update, props); } exports.useCollectionStoreProps = useCollectionStoreProps; exports.useCollectionStore = useCollectionStore;