Skip to content

Commit

Permalink
docs: Fix encapsulation decorators example (#2840)
Browse files Browse the repository at this point in the history
* docs: Fix encapsulation decorators example

* docs: clarify encapsulation decorators example
  • Loading branch information
anthonyringoet committed Feb 8, 2021
1 parent 48cc17a commit 300c9a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/Encapsulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ fastify.register(async function authenticatedContext (childServer) {
handler (request, response) {
response.send({
answer: request.answer,
// request.foo will be undefined as it's only defined in publicContext
foo: request.foo,
// request.bar will be undefined as it's only defined in grandchildContext
bar: request.bar
})
}
Expand All @@ -69,6 +71,7 @@ fastify.register(async function publicContext (childServer) {
response.send({
answer: request.answer,
foo: request.foo,
// request.bar will be undefined as it's only defined in grandchildContext
bar: request.bar
})
}
Expand Down

0 comments on commit 300c9a4

Please sign in to comment.