Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big if/else blocks #72

Open
tonylomaxtk opened this issue Nov 14, 2023 · 0 comments
Open

Big if/else blocks #72

tonylomaxtk opened this issue Nov 14, 2023 · 0 comments

Comments

@tonylomaxtk
Copy link

Try and makes these shorter and return early. Also I don't quite follow the logic, else if (latestGameId !== null) would never run because if latestGameId is a string then the first block will run. I might be missing something but as I say it's hard to follow the logic because the blocks are so long.

See if you can break them down and also consider whether you really need an else if statement - often you don't and it just confuses things.

https://github.com/fac28/in-house-project/blob/9d2c5085cc1e6508c0d79e905a68988a41513b0b/app/components/Button/HomeStartButton.tsx#L110C5-L110C5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant