import { useCallback } from "react";
import { unstable_batchedUpdates } from "react-dom";
const useConnectSelectedEntities = (createNewEntity) => {
  return useCallback((selectedEntities) => {
    unstable_batchedUpdates(() => {
      for (const selected of selectedEntities) {
        createNewEntity((getEntity) => {
          selected(getEntity());
        });
      }
    });
  }, [createNewEntity]);
};
export { useConnectSelectedEntities };
//# sourceMappingURL=useConnectSelectedEntities.js.map
