import { useEffect, useState } from 'react';
import { CollectionDatasetSyncState, } from '../state/CollectionDatasetSync/CollectionDatasetSyncState';
export function useCollectionDatasetSync(collection, props) {
    const [state] = useState(() => new CollectionDatasetSyncState({
        dataset: props.dataset,
        onDatasetChange: props.onDatasetChange,
        collection,
    }));
    state.onDatasetChange = props.onDatasetChange;
    useEffect(() => state.init(), [state]);
    useEffect(() => {
        state.setDataset(props.dataset);
    }, [props.dataset]);
}
//# sourceMappingURL=useCollectionDatasetSync.js.map