From a6f21956acf8efa25f59b638eca70cfbb04a9b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 20 Jan 2021 11:59:32 +0100 Subject: [PATCH] docs: try ts for syntax highlight --- docs/content/en/hooks.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/content/en/hooks.md b/docs/content/en/hooks.md index dc9b32a..62da405 100644 --- a/docs/content/en/hooks.md +++ b/docs/content/en/hooks.md @@ -11,8 +11,9 @@ The `arguments` listed below are those your hook will receive when it's called. - arguments: `(config)` -**Example: ** -```js{}[plugins/http.js] +**Example:** + +```ts [plugins/http.js] export default function ({ $http }) { $http.onRequest(config => { console.log('Making request to ' + config.url) @@ -26,8 +27,9 @@ See [here](/advanced#hooks) for advanced usage. - arguments: `(request, options, response)` -**Example: ** -```js{}[plugins/http.js] +**Example:** + +```ts [plugins/http.js] export default function ({ $http }) { $http.onResponse((req, options, res) => { console.log('Making request to ' + req.url) @@ -45,8 +47,9 @@ See [here](/advanced#hooks) for advanced usage. If the error originated from a request. -**Example: ** -```js{}[plugins/http.js] +**Example:** + +```ts [plugins/http.js] export default function ({ $http, redirect }) { $http.onError((err) => { // In case of unauthorized, redirect to a specific page