From 3dd1047b085fa7795f322c5829f39208465bff13 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 29 Mar 2022 09:58:06 -0300 Subject: added react eslint and fix most of the warns --- packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts') diff --git a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts index 5bd2d6f81..68bc9aed7 100644 --- a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts +++ b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts @@ -14,9 +14,7 @@ TALER; see the file COPYING. If not, see */ import { - NotificationType, - TalerErrorCode, - TalerErrorDetail, + NotificationType, TalerErrorDetail } from "@gnu-taler/taler-util"; import { TalerError } from "@gnu-taler/taler-wallet-core"; import { useEffect, useState } from "preact/hooks"; @@ -50,7 +48,7 @@ export function useAsyncAsHook( ): HookResponse { const [result, setHookResponse] = useState>(undefined); useEffect(() => { - async function doAsync() { + async function doAsync(): Promise { try { const response = await fn(); setHookResponse({ hasError: false, response }); @@ -76,6 +74,6 @@ export function useAsyncAsHook( doAsync(); }); } - }, []); + }); return result; } -- cgit v1.2.3