Skip to content
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/routes/guides/fetching-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ The `Switch/Match` construct provides one way to manage these conditions.
When the fetch succeeds and user data is retrieved, the `user()` condition becomes active, and its related block executes.
However, if there's an error while fetching, the `user.error` block becomes `true`, leading to its corresponding `Match` block being shown.

:::tip

If you anticipate errors, you may want to wrap `createResource` in an [ErrorBoundary](/reference/components/error-boundary).

:::

In addition to the `error` property, the `loading` property offers a way to display a loading state to the user during the fetch operation.


Expand Down
Loading