Skip to content

Commit

Permalink
docs(plugins): note side-effect when using await in `fastify.regist…
Browse files Browse the repository at this point in the history
…er()` (#4846)

* Add documentation for side-effect when using await in fastify.register()

* Apply suggestions from code review

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>

---------

Co-authored-by: Uzlopak <aras.abbasi@googlemail.com>
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
3 people committed Jul 9, 2023
1 parent c170bea commit 139a523
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/Reference/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ await fastify.ready()

await fastify.listen({ port: 3000 })
```
*Note: Using `await` when registering a plugin loads the plugin
and the underlying dependency tree, "finalizing" the encapsulation process.
Any mutations to the plugin after it and its dependencies have been
loaded will not be reflected in the parent instance.*

#### ESM support
<a id="esm-support"></a>
Expand Down

0 comments on commit 139a523

Please sign in to comment.