Skip to content

Commit 5a6f290

Browse files
authored
[chore] Documentation on status and error in page store (#3534)
* added documentation on status and error in page store * changed wording * blank line
1 parent 39f556a commit 5a6f290

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: documentation/docs/02-layouts.md

+2
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,6 @@ If an error component has a [`load`](#loading) function, it will be called with
111111
<h1>{title}</h1>
112112
```
113113

114+
> Layout components also have access to `error` and `status` via the [page store](#modules-$app-stores)
115+
>
114116
> Server-side stack traces will be removed from `error` in production, to avoid exposing privileged information to users.

Diff for: documentation/docs/05-modules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Because of that, the stores are not free-floating objects: they must be accessed
6868
The stores themselves attach to the correct context at the point of subscription, which means you can import and use them directly in components without boilerplate. However, it still needs to be called synchronously on component or page initialisation when the `$`-prefix isn't used. Use `getStores` to safely `.subscribe` asynchronously instead.
6969

7070
- `navigating` is a [readable store](https://svelte.dev/tutorial/readable-stores). When navigating starts, its value is `{ from, to }`, where `from` and `to` are both [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) instances. When navigating finishes, its value reverts to `null`.
71-
- `page` contains an object with the current [`url`](https://developer.mozilla.org/en-US/docs/Web/API/URL), [`params`](#loading-input-params) and [`stuff`](#loading-output-stuff).
71+
- `page` contains an object with the current [`url`](https://developer.mozilla.org/en-US/docs/Web/API/URL), [`params`](#loading-input-params), [`stuff`](#loading-output-stuff), [`status`](#loading-output-status) and [`error`](#loading-output-error).
7272
- `session` is a [writable store](https://svelte.dev/tutorial/writable-stores) whose initial value is whatever was returned from [`getSession`](#hooks-getsession). It can be written to, but this will _not_ cause changes to persist on the server — this is something you must implement yourself.
7373

7474
### $lib

0 commit comments

Comments
 (0)