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

Refactor downloadBundleUri with Early Returns and Consistent Async/Await (#56) #57

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

BangDori
Copy link
Contributor

Description

This PR refactors the downloadBundleUri function to simplify its logic and improve maintainability. It addresses the concerns raised in Issue #56 by replacing nested if-else blocks with early returns and ensuring a consistent use of async/await for asynchronous operations.

Changes

  1. Replaced nested if-else blocks with early returns for cleaner control flow.
  2. Applied a consistent async/await pattern instead of mixing promise chains.
  3. Changed instances of return; to return installFail(...) to explicitly indicate error handling, improving code clarity (functionally equivalent as installFail() returns void).

Expected Results

These changes are expected to improve the maintainability and scalability of the code. The refactored function should operate identically to the previous version while providing a clearer structure and improved error handling.

Please review and provide your feedback!

- Replace nested if-else blocks with early returns for cleaner control flow
- Use async/await consistently instead of mixing promise chains
- Improve overall readability
@vantuan88291
Copy link
Owner

Thanks, released to version 2.1.2

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

Successfully merging this pull request may close these issues.

2 participants