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

Fix primitive value #52

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

Llyrus
Copy link

@Llyrus Llyrus commented Aug 7, 2024

Description

Updated getBookURL function to return a Promise:
Previously, the getBookURL function returned a primitive string value. This caused issues when used with the await keyword, as await expects a Promise. The function has been modified to return a Promise, resolving with the constructed book URL or rejecting with an error message if the URL is not found.

Updated fetchBook function to handle asynchronous nature of getBookURL:
Changed the call to getBookURL within fetchBook to use await to correctly handle the returned Promise. This ensures that the asynchronous URL retrieval is handled properly, allowing the rest of the function to operate on the resolved string value.

Motivation / Context

Ensures proper handling of asynchronous operations in the fetchBook function, preventing runtime errors related to incorrect usage of await.
Improves code reliability and correctness when fetching book URLs, enhancing the overall stability of the application.

Testing Instructions / How This Has Been Tested

Installed webpack, ran the build and tested it on ProQuest eBook

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.

1 participant