Skip to content

Commit

Permalink
chore: make Higher Order Function non arrow style to increase readabi…
Browse files Browse the repository at this point in the history
…lity, this is an exeption from the rule
  • Loading branch information
peter-sanderson committed Jan 10, 2025
1 parent 64fcbde commit 5a333c3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export const useCoinmarketModalCrypto = ({ receiveCurrency }: CoinmarketModalCry
}, [receiveCurrency, dispatch]);

// after unmount set off CryptoSymbol for modals
useEffect(
() => () => {
// eslint-disable-next-line arrow-body-style
useEffect(() => {
return () => {
dispatch({
type: SET_MODAL_CRYPTO_CURRENCY,
modalCryptoId: undefined,
});
},
[dispatch],
);
};
}, [dispatch]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,14 @@ export const useCoinmarketBuyForm = ({
],
);

useEffect(
() => () => {
// eslint-disable-next-line arrow-body-style
useEffect(() => {
return () => {
if (abortControllerRef.current) {
abortControllerRef.current.abort();
}
},
[],
);
};
}, []);

return {
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,14 @@ export const useCoinmarketExchangeForm = ({
handleChange,
]);

useEffect(
() => () => {
// eslint-disable-next-line arrow-body-style
useEffect(() => {
return () => {
if (abortControllerRef.current) {
abortControllerRef.current.abort();
}
},
[],
);
};
}, []);

// handle edge case when there are no longer quotes of selected exchange type
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,14 +647,14 @@ export const useCoinmarketSellForm = ({
handleChange,
]);

useEffect(
() => () => {
// eslint-disable-next-line arrow-body-style
useEffect(() => {
return () => {
if (abortControllerRef.current) {
abortControllerRef.current.abort();
}
},
[],
);
};
}, []);

return {
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export const ConnectDeviceScreenHeader = ({
}, [handleCancel]);

// Hide alert when navigating away from the PIN entry screen (PIN entered or canceled on device)
useEffect(
() => () => {
// eslint-disable-next-line arrow-body-style
useEffect(() => {
return () => {
hideAlert();
},
[hideAlert],
);
};
}, [hideAlert]);

return (
<ScreenHeaderWrapper>
Expand Down

0 comments on commit 5a333c3

Please sign in to comment.