Skip to content

Commit

Permalink
docs: use computed key when assigning property to request (#2100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmazzola committed Feb 16, 2020
1 parent da4c89d commit b44d859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Plugins-Guide.md
Expand Up @@ -181,7 +181,7 @@ We've seen how to extend server functionality and how to handle the encapsulatio
## Hooks
You just built an amazing utility, but now you need to execute that for every request, this is what you will likely do:
```js
fastify.decorate('util', (request, key, value) => { request.key = value })
fastify.decorate('util', (request, key, value) => { request[key] = value })

fastify.get('/plugin1', (request, reply) => {
fastify.util(request, 'timestamp', new Date())
Expand Down

0 comments on commit b44d859

Please sign in to comment.