From 578313a726f3b92bd143f173902f53d9f03b12a1 Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 26 Mar 2023 09:48:08 +0200 Subject: [PATCH 1/3] add: onRequestAbort --- snippets/snippets-js.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/snippets/snippets-js.json b/snippets/snippets-js.json index 1710868..038c85d 100644 --- a/snippets/snippets-js.json +++ b/snippets/snippets-js.json @@ -171,6 +171,20 @@ ], "description": "Add an instance fastify onError hook" }, + "fastify hook onRequestAbort": { + "scope": "javascript,typescript", + "prefix": [ + "ffonrequestabort", + "hookonrequestabort" + ], + "body": [ + "app.addHook('onRequestAbort', function hook (request, reply, done) {", + " // Notice: run when a client closes the connection before. Therefore, you will not be able to send data to the client.", + " done()", + "})" + ], + "description": "Add an instance fastify onRequestAbort hook" + }, "fastify hook onSend": { "scope": "javascript,typescript", "prefix": [ From 09c8851e06b2e0ff5d7ef7e88266e086f78180dd Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 26 Mar 2023 09:49:25 +0200 Subject: [PATCH 2/3] add: doc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ed28398..2609311 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ fastify hook preValidation|Add an instance fastify preValidation hook|ffprevalid fastify hook preHandler|Add an instance fastify preHandler hook|ffprehandler, hookprehandler fastify hook preSerialization|Add an instance fastify preSerialization hook|ffpreserialization, hookpreserialization fastify hook onError|Add an instance fastify onError hook|ffonerror, hookonerror +fastify hook onRequestAbort|Add an instance fastify onRequestAbort hook|ffonrequestabort, hookonrequestabort fastify hook onSend|Add an instance fastify onSend hook|ffonsend, hookonsend fastify hook onResponse|Add an instance fastify onResponse hook|ffonresponse, hookonresponse fastify hook onTimeout|Add an instance fastify onTimeout hook|ffontimeout, hookontimeout From bad58cc8416589b176b830722036c5233d27e2a2 Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sun, 26 Mar 2023 09:50:11 +0200 Subject: [PATCH 3/3] add: doc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2609311..da3bf56 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,4 @@ First, you must be added into the [Fastify publisher](https://marketplace.visual - Manually bump the version in the `package.json` - Run `npm run vscode:pack` - Run `npm run vscode:publish` +- Commit&Push the new version to the `main` branch