Skip to content

Commit 001840b

Browse files
committed
rm conditional rendering
1 parent 21a2a93 commit 001840b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/routes/reference/basic-reactivity/create-resource.mdx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,4 @@ const [user] = createResource(() => fetchUser(), {
268268

269269
// user() is never undefined
270270
console.log(user().name); // "Loading..." initially
271-
```
272-
273-
### Conditional fetching
274-
275-
```typescript
276-
const [isEnabled, setIsEnabled] = createSignal(false);
277-
278-
const [data] = createResource(
279-
() => isEnabled() && userId(), // Only fetches when enabled and userId exists
280-
async (id) => fetchUserData(id)
281-
);
282-
```
271+
```

0 commit comments

Comments
 (0)