import { useContext } from "react";
import { ToastlyContext } from "./ToastlyProvider";

export function useToastly() {
  const context = useContext(ToastlyContext);
  if (!context) {
    throw new Error("useToastly must be used within a ToastlyProvider");
  }
  return context;
}
