import { useEffect } from "react";
import { error } from "../dev-warning";
import useDev from "./use-dev";

export default function useDevSetupWarning(fn, inputs) {
  useDev(() => {
    useEffect(() => {
      try {
        fn();
      } catch (e) {
        error(`
          A setup problem was encountered.

          > ${e.message}
        `);
      }
    }, inputs);
  });
}
