docs: missing word (#909)

add `wait` in `...the second hook will wait for the first to complete before it starts.`
This commit is contained in:
Petre Tudor
2022-08-10 13:59:52 +02:00
committed by GitHub
parent 63a0336e98
commit 63519a8f54

View File

@@ -28,7 +28,7 @@ There are many more use cases for Hooks and the sky is the limit.
#### Async vs. synchronous
All hooks can be written as either synchronous or asynchronous functions. If the Hook should modify data before a document is updated or created, and it relies on asynchronous actions such as fetching data from a third party, it might make sense to define your Hook as an asynchronous function, so you can be sure that your Hook completes before the operation's lifecycle continues. Async hooks are run in series - so if you have two async hooks defined, the second hook will for the first to complete before it starts.
All hooks can be written as either synchronous or asynchronous functions. If the Hook should modify data before a document is updated or created, and it relies on asynchronous actions such as fetching data from a third party, it might make sense to define your Hook as an asynchronous function, so you can be sure that your Hook completes before the operation's lifecycle continues. Async hooks are run in series - so if you have two async hooks defined, the second hook will wait for the first to complete before it starts.
If your Hook simply performs a side-effect, such as updating a CRM, it might be okay to define it synchronously, so the Payload operation does not have to wait for your hook to complete.