Skip to content

Commit

Permalink
correct user and user.error in guildes/fetching-data examples (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurov authored Aug 17, 2024
1 parent 799f768 commit 0de28d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/guides/fetching-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const fetchUser = async (id) =>

function App() {
const [userId, setUserId] = createSignal();
const [user] = createResource(userId(), fetchUser);
const [user] = createResource(userId, fetchUser);

return (
<div>
Expand Down Expand Up @@ -109,7 +109,7 @@ function App() {

<Switch>
<Match when={user.error}>
<span>Error: {user.error()}</span>
<span>Error: {user.error.message}</span>
</Match>
<Match when={user()}>
<div>{JSON.stringify(user())}</div>
Expand Down

0 comments on commit 0de28d5

Please sign in to comment.