import { useWixPatternsContainer, useCreateCollection, } from '@wix/bex-core/react';
import { GridState } from '../state';
import { useOptionalCachedState } from './useOptionalCachedState';
export const useGridCollection = (config) => {
    const container = useWixPatternsContainer();
    const createCollection = useCreateCollection();
    const state = useOptionalCachedState(() => new GridState({
        collection: createCollection(config),
        container,
    }));
    return state;
};
//# sourceMappingURL=useGridCollection.js.map