diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-03 01:57:39 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-03 01:58:18 -0300 |
commit | a2668c22f0d18386fc988f27299172145d9fa15d (patch) | |
tree | 38f06046ce4d71ee3af64ede931754bfae6dc954 /packages/merchant-backoffice-ui/src/hooks/async.ts | |
parent | d1aa79eae817b1cf4c23f800308ecad101692ac7 (diff) | |
download | wallet-core-a2668c22f0d18386fc988f27299172145d9fa15d.tar.xz |
refactor better QA
removed axios, use fetch
removed jest, added mocha and chai
moved the default request handler to runtime dependency (so it can be replaced for testing)
refactored ALL the test to the standard web-utils
all hooks now use ONE request handler
moved the tests from test folder to src
Diffstat (limited to 'packages/merchant-backoffice-ui/src/hooks/async.ts')
-rw-r--r-- | packages/merchant-backoffice-ui/src/hooks/async.ts | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/packages/merchant-backoffice-ui/src/hooks/async.ts b/packages/merchant-backoffice-ui/src/hooks/async.ts index 6c116e628..f22badc88 100644 --- a/packages/merchant-backoffice-ui/src/hooks/async.ts +++ b/packages/merchant-backoffice-ui/src/hooks/async.ts @@ -19,7 +19,6 @@ * @author Sebastian Javier Marchano (sebasjm) */ import { useState } from "preact/hooks"; -import { cancelPendingRequest } from "./backend.js"; export interface Options { slowTolerance: number; @@ -62,8 +61,7 @@ export function useAsync<T>( clearTimeout(handler); }; - function cancel() { - cancelPendingRequest(); + function cancel(): void { setLoading(false); setSlow(false); } |