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

Misleading bit about asynchronous vs synchronous hooks #10460

Open
martinsotirov opened this issue Jan 8, 2025 · 0 comments
Open

Misleading bit about asynchronous vs synchronous hooks #10460

martinsotirov opened this issue Jan 8, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@martinsotirov
Copy link

Documentation Issue

The way this is formulated is just plain wrong and misleading. I'm guessing the author meant that in the one case the callback (hook) is awaited and in the other case it's directly executed. When you remove the "async" keyword, you don't end up with "synchronous code". In fact in this specific case it's the exact opposite - using "async" makes your code synchronous because Payload awaits the implicit promise that gets created around an "async" function.

@martinsotirov martinsotirov added the documentation Improvements or additions to documentation label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant