1 import { useEffect, useState } from 'react';
4 * Custom hook that allows throwing an error asynchronously.
5 * Source: https://medium.com/trabe/catching-asynchronous-errors-in-react-using-error-boundaries-5e8a5fd7b971
6 * @returns {function} throwError - A function that can be called to throw an error.
8 const useAsyncError = () => {
9 const [error, setError] = useState<Error | null>(null);
20 export default useAsyncError;