You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename handle's render parameter to resolve (#1566)
* Rename handle's render parameter to respond
* Rename to resolve
* Update 04-hooks.md
remove reference to 'renderer', which is confusing now that we no longer use `render`
Co-authored-by: Rich Harris <[email protected]>
Copy file name to clipboardExpand all lines: documentation/docs/04-hooks.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ An optional `src/hooks.js` (or `src/hooks.ts`, or `src/hooks/index.js`) file exp
8
8
9
9
### handle
10
10
11
-
This function runs on every request, and determines the response. It receives the `request` object and `render` method, which calls SvelteKit's default renderer. This allows you to modify response headers or bodies, or bypass SvelteKit entirely (for implementing endpoints programmatically, for example).
11
+
This function runs on every request, for both pages and endpoints, and determines the response. It receives the `request` object and a function called `resolve`, which invokes SvelteKit's router and generates a response accordingly. This allows you to modify response headers or bodies, or bypass SvelteKit entirely (for implementing endpoints programmatically, for example).
12
12
13
-
If unimplemented, defaults to `({ request, render }) => render(request)`.
13
+
If unimplemented, defaults to `({ request, resolve }) => resolve(request)`.
14
14
15
15
To add custom data to the request, which is passed to endpoints, populate the `request.locals` object, as shown below.
0 commit comments