import { useState as a, useCallback as f } from "react";
const p = (s, c) => {
  const [t, u] = a(c), [l, n] = a(() => s(t)), r = f(
    (e) => {
      const o = typeof e == "function" ? e(t) : e;
      u(o), n(s(o));
    },
    [s, t]
  );
  return [t, r, l];
};
export {
  p as default
};
//# sourceMappingURL=useStateWithValidation.js.map
