File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ The `arguments` listed below are those your hook will receive when it's called.
11
11
12
12
- arguments: ` (config) `
13
13
14
- ** Example: **
15
- ``` js{}[plugins/http.js]
14
+ ** Example:**
15
+
16
+ ``` ts [plugins/http.js]
16
17
export default function ({ $http }) {
17
18
$http .onRequest (config => {
18
19
console .log (' Making request to ' + config .url )
@@ -26,8 +27,9 @@ See [here](/advanced#hooks) for advanced usage.
26
27
27
28
- arguments: ` (request, options, response) `
28
29
29
- ** Example: **
30
- ``` js{}[plugins/http.js]
30
+ ** Example:**
31
+
32
+ ``` ts [plugins/http.js]
31
33
export default function ({ $http }) {
32
34
$http .onResponse ((req , options , res ) => {
33
35
console .log (' Making request to ' + req .url )
@@ -45,8 +47,9 @@ See [here](/advanced#hooks) for advanced usage.
45
47
46
48
If the error originated from a request.
47
49
48
- ** Example: **
49
- ``` js{}[plugins/http.js]
50
+ ** Example:**
51
+
52
+ ``` ts [plugins/http.js]
50
53
export default function ({ $http , redirect }) {
51
54
$http .onError ((err ) => {
52
55
// In case of unauthorized, redirect to a specific page
You can’t perform that action at this time.
0 commit comments