Skip to content

Commit 381c2e6

Browse files
Apply suggestions from code review
Co-authored-by: Amir Hossein Hashemi <87268103+amirhhashemi@users.noreply.github.com>
1 parent 2298c40 commit 381c2e6

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Custom storage function for the resource value, useful for persistence or custom
154154

155155
Callback fired when the resource hydrates on the client side.
156156

157-
## Return Value
157+
## Return value
158158

159159
- **Type:** `[Resource<T>, ResourceActions<T, R>]`
160160

@@ -195,7 +195,7 @@ type ResourceActions<T, R = unknown> = {
195195
};
196196
```
197197

198-
- `mutate`: Function to Manually overwrite the resource value without calling the fetcher.
198+
- `mutate`: Function to manually overwrite the resource value without calling the fetcher.
199199
Allows you to optimistically update the resource value locally, without making a network request.
200200
- `refetch`: Function to re-run the fetcher without changing the source.
201201
If a parameter is provided to `refetch`, it will be passed to the fetcher's `refetching` property.
@@ -216,7 +216,7 @@ console.log(data.loading); // true during fetch
216216
console.log(data.state); // "pending" → "ready"
217217
```
218218

219-
### With Source
219+
### With source
220220

221221
```typescript
222222
const [userId, setUserId] = createSignal(1);
@@ -230,7 +230,7 @@ const [user] = createResource(userId, async (id) => {
230230
setUserId(2);
231231
```
232232

233-
### With Actions
233+
### With actions
234234

235235
```typescript
236236
const [posts, { refetch, mutate }] = createResource(fetchPosts);
@@ -257,7 +257,7 @@ const [data] = createResource(async () => {
257257
</ErrorBoundary>
258258
```
259259

260-
### With Initial Value
260+
### With initial value
261261

262262
```typescript
263263
const [user] = createResource(() => fetchUser(), {
@@ -268,7 +268,7 @@ const [user] = createResource(() => fetchUser(), {
268268
console.log(user().name); // "Loading..." initially
269269
```
270270

271-
### Conditional Fetching
271+
### Conditional fetching
272272

273273
```typescript
274274
const [isEnabled, setIsEnabled] = createSignal(false);

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Signals are optimized for frequent reads and infrequent writes
2424
import { createSignal } from "solid-js";
2525
```
2626

27-
## Type Signature
27+
## Type signature
2828

2929
```typescript
3030
function createSignal<T>(): Signal<T | undefined>;
@@ -59,7 +59,8 @@ interface SignalOptions<T> {
5959
- **Type:** `T`
6060
- **Default:** `undefined`
6161

62-
The initial value for the signal. If no initial value is provided, the signal's type is automatically extended with `undefined`.
62+
The initial value for the signal.
63+
If no initial value is provided, the signal's type is automatically extended with `undefined`.
6364

6465
### `options`
6566

@@ -75,8 +76,8 @@ Dev-only options like `name` are ignored, and no warnings are issued, ensuring t
7576
- **Type:** `string`
7677
- **Default:** `undefined`
7778

78-
A name for the signal used for debugging purposes in development mode.
79-
The name will show up in console messages and in the [Solid devtools](https://github.com/thetarnav/solid-devtools).
79+
A name for the signal used by debugging tools like [Solid devtools](https://github.com/thetarnav/solid-devtools).
80+
It works only in development mode and is removed from the production bundle.
8081

8182
#### `equals`
8283

@@ -96,7 +97,7 @@ This can be useful to create a Signal that triggers manual updates in the reacti
9697
Marks the signal as internal, preventing it from appearing in development tools.
9798
This is primarily used by Solid's internal systems.
9899

99-
## Return Value
100+
## Return value
100101

101102
- **Type:** `Signal<T>`
102103

0 commit comments

Comments
 (0)