import { useContext } from "react";
import { DataSourceContext } from "./DataSourceContext";

export const useDataSource = () => {
  const context = useContext(DataSourceContext);
  if (context === undefined)
    throw new Error("useDataSource must be used within a DataSourceProvider");

  return context;
};
