github
499 of 600 branches covered (83.17%)
Branch coverage included in aggregate %.
306 of 993 new or added lines in 10 files covered. (30.82%)
1 existing line in 1 file now uncovered.6756 of 7664 relevant lines covered (88.15%)
18.51 hits per line
|
import { |
1✔ |
|
TransactionStageStatus, |
1✔ |
|
TransactionWaitStatus, |
1✔ |
|
} from "./TransactionStatus";
|
1✔ |
|
|
1✔ |
|
export const transactionState = ( |
1✔ |
NEW
|
prepare: TransactionWaitStatus, |
× |
NEW
|
execute: TransactionStageStatus, |
× |
NEW
|
wait: TransactionWaitStatus, |
× |
NEW
|
disableOnSuccess: boolean = true,
|
× |
NEW
|
) => { |
× |
NEW
|
const loading =
|
× |
NEW
|
prepare.fetchStatus === "fetching" ||
|
× |
NEW
|
execute.status === "pending" ||
|
× |
NEW
|
wait.fetchStatus === "fetching";
|
× |
NEW
|
|
× |
NEW
|
const disabled =
|
× |
NEW
|
prepare.error !== null || |
× |
NEW
|
(disableOnSuccess && wait.status === "success");
|
× |
NEW
|
|
× |
NEW
|
return { loading, disabled };
|
× |
NEW
|
}; |
× |