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

Documentation: replace fastify.decorate arrow functions with function expressions #3577

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/Reference/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ callback.
Example:
```js
module.exports = function (fastify, opts, done) {
fastify.decorate('utility', () => {})
fastify.decorate('utility', function () {})

fastify.get('/', handler)

Expand All @@ -191,7 +191,7 @@ module.exports = function (fastify, opts, done) {
You can also use `register` inside another `register`:
```js
module.exports = function (fastify, opts, done) {
fastify.decorate('utility', () => {})
fastify.decorate('utility', function () {})

fastify.get('/', handler)

Expand Down Expand Up @@ -226,7 +226,7 @@ plugin will support.
const fp = require('fastify-plugin')

module.exports = fp(function (fastify, opts, done) {
fastify.decorate('utility', () => {})
fastify.decorate('utility', function () {})
done()
}, '0.x')
```
Expand All @@ -239,7 +239,7 @@ changes it will be your responsibility to update the module, while if you use
`fastify-plugin`, you can be sure about backward compatibility.
```js
function yourPlugin (fastify, opts, done) {
fastify.decorate('utility', () => {})
fastify.decorate('utility', function () {})
done()
}
yourPlugin[Symbol.for('skip-override')] = true
Expand Down