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

Removed return await calls #159

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Removed return await calls #159

merged 1 commit into from
Sep 13, 2023

Conversation

liamboddin
Copy link
Contributor

When a function is async, it automatically returns the return type wrapped into a Promise. If we make a database call, the return type is a Promise that contains the data. Unwrapping this before directly wrapping it back again into a Promise in the execution of the return statement is just unnecessary and might add some more overhead for the database calls, as this Unwrapping (the database call) - Wrapping (with the return call) - Unwrapping (in the calling function) might add a little overhead.

@liamboddin liamboddin merged commit 7d03040 into development Sep 13, 2023
1 check passed
@liamboddin liamboddin deleted the 158-return-await branch September 13, 2023 13:16
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