Skip to content

Commit a6f2195

Browse files
authored
docs: try ts for syntax highlight
1 parent d61ed49 commit a6f2195

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Diff for: docs/content/en/hooks.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ The `arguments` listed below are those your hook will receive when it's called.
1111

1212
- arguments: `(config)`
1313

14-
**Example: **
15-
```js{}[plugins/http.js]
14+
**Example:**
15+
16+
```ts [plugins/http.js]
1617
export default function ({ $http }) {
1718
$http.onRequest(config => {
1819
console.log('Making request to ' + config.url)
@@ -26,8 +27,9 @@ See [here](/advanced#hooks) for advanced usage.
2627

2728
- arguments: `(request, options, response)`
2829

29-
**Example: **
30-
```js{}[plugins/http.js]
30+
**Example:**
31+
32+
```ts [plugins/http.js]
3133
export default function ({ $http }) {
3234
$http.onResponse((req, options, res) => {
3335
console.log('Making request to ' + req.url)
@@ -45,8 +47,9 @@ See [here](/advanced#hooks) for advanced usage.
4547

4648
If the error originated from a request.
4749

48-
**Example: **
49-
```js{}[plugins/http.js]
50+
**Example:**
51+
52+
```ts [plugins/http.js]
5053
export default function ({ $http, redirect }) {
5154
$http.onError((err) => {
5255
// In case of unauthorized, redirect to a specific page

0 commit comments

Comments
 (0)