You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2ccece3
Browse filesBrowse the repository at this point in the historyBrowse files
docs: re-sync the API reference against solid next and add the until page
- Disposition the exports added since the last sync: until (new reference
page under Lifecycle & Actions, folding UntilOptions, Truthy, and
TimeoutError), registerFlightDataSource (single-flight page),
LiveServerFunction (live), DynamicOptions (dynamic), PreloadLink
(renderToStream), and the attribution/observe types (DEV).
- Hide the wire-protocol constants and the store-target introspection
helpers consumed by the DOM list driver.
- Add tone fixups for emphasis capitals in the upstream JSDoc.
- Regenerate all 93 reference pages from solid@05725e84.
- Stores: add 'fetch in memos, shape in stores' guidance.
Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -550,7 +568,17 @@ const HIDDEN_EXPORTS = new Set([
550
568
"GENERIC_SERVER_ERROR_MESSAGE",
551
569
"HREF",
552
570
"INSTANCE_HEADER",
571
+
"NULL_BODY_STATUSES",
572
+
"REDIRECT_HEADER",
573
+
"RESPONSE_HEADER_VALUE_LIMIT",
553
574
"REVALIDATE_HEADER",
575
+
"UNKNOWN_HEADER",
576
+
"decodeRedirectHeaderValue",
577
+
"getFlightDataSourceIds",
578
+
// Store-target introspection consumed by the DOM list driver.
579
+
"storeHasFamily",
580
+
"storeHasOptimisticFamily",
581
+
"storeIsShallow",
554
582
"RequestContext",
555
583
"SAFE_ERROR",
556
584
"SERVER_FUNCTION_INVOKE",
@@ -626,6 +654,8 @@ const ENTRY_CALLOUTS = {
626
654
};
627
655
628
656
constENTRY_SUMMARY_OVERRIDES={
657
+
until:
658
+
"Awaits a reactive predicate and resolves the first time it becomes truthy, with the narrowed value. A falsy result or a pending async read means not yet, so the subscription stays live and re-evaluates as sources change. A thrown error, a rejected async source, a timeout, or an abort rejects the promise.",
629
659
affects:
630
660
"Marks a reactive source or store location as pending while work that will change it is in flight. Marked values remain readable, and derived readers report the pending state until the surrounding action or update settles.",
631
661
clientOnly:
@@ -923,6 +953,22 @@ const REFERENCE_FIXUPS = [
923
953
"createSignal<T>(fn, options?:",
924
954
],
925
955
[/thepayloadjusthastobe/g,"the payload must be"],
956
+
[/readstheAUTHORITATIVEview/g,"reads the authoritative view"],
957
+
[/target'sNEXTQUIESCENT\s+STATE/g,"target's next settled state"],
958
+
[/transactionisSTAGED;/g,"transaction is staged;"],
959
+
[/IMPORTANTforimplementers/g,"Important for implementers"],
960
+
[/FiredBEFORE\b/g,"Fired before"],
961
+
[/againsttheDOCUMENT\s+URL/g,"against the document URL"],
962
+
[/itisENTRY-ONLY:/g,"it is entry-only:"],
963
+
[/fromREADINGtheresponse/g,"from reading the response"],
964
+
[/toEXECUTEfromanyorigin/g,"to execute from any origin"],
`rows` is where you attach request-level concerns: [`isPending(rows)`](/reference/solid-js/reactivity/is-pending) for the refetch indicator, [`refresh(rows)`](/reference/solid-js/lifecycle-actions/refresh) to re-ask, a second consumer that reads the same response.
179
+
`table` is where per-row tracking and reconciliation happen; when a new response lands, `rows` changes once and the store diffs it once.
180
+
The line between them is the visible marker of where a request-level policy lives, and it is the shape the rest of the docs use when a fetch and a store appear together.
181
+
166
182
## Optimistic stores
167
183
168
184
`createOptimisticStore` has the same nested draft update model with a tentative overlay.
Copy file name to clipboardExpand all lines: src/routes/(2)concepts/(3)async-reactivity.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -762,6 +762,7 @@ Use `yield promise` as the suspension point, or place a bare `yield` before writ
762
762
- Use [`refresh`](/reference/solid-js/lifecycle-actions/refresh) to rerun a derived source with the same inputs.
763
763
- Use [`affects`](/reference/solid-js/lifecycle-actions/affects) to declare which data in-flight work can change.
764
764
- Use [`resolve`](/reference/solid-js/advanced/interop-async/resolve) to await one reactive expression outside tracking.
765
+
- Use [`until`](/reference/solid-js/lifecycle-actions/until) inside an action to hold it open until a predicate over confirmed state becomes true, such as a live source echoing the write.
765
766
- Use [`onSettled`](/reference/solid-js/lifecycle-actions/on-settled) to run code after owned async work and queued updates settle.
766
767
- Use `loadingValue` or `seedLoadingValue` when a placeholder value should answer for a source before its first result.
Copy file name to clipboardExpand all lines: src/routes/reference/(1)solid-js/(3)lifecycle-actions/refresh.mdx
+32-9Lines changed: 32 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,42 @@ tags:
10
10
- "api"
11
11
- "v2"
12
12
version: "2.0"
13
-
description: "Invalidates one reactive source, forcing it to re-execute even if its inputs\nhaven't changed."
13
+
description: "Invalidates one reactive source, forcing it to re-execute even if its inputs\nhaven't changed, and returns a promise for the target's next settled state — the re-ask (and anything that supersedes it) has settled."
14
14
source_repo: "solidjs/solid"
15
15
source_ref: "next"
16
-
source_path: "packages/signals/src/core/core.ts"
16
+
source_path: "packages/signals/src/signals.ts"
17
17
---
18
18
19
19
{/* Generated by scripts/extract-solid-ref.mjs. Edit the source JSDoc or disposition map, then regenerate. */}
20
20
21
21
Invalidates one reactive source, forcing it to re-execute even if its inputs
22
-
haven't changed.
22
+
haven't changed, and returns a promise for the target's next settled state — the re-ask (and anything that supersedes it) has settled.
23
23
24
24
Pass either a Solid-created accessor or a projected store created from
25
25
`createStore(fn, ...)` / `createProjection(...)`. `refresh()` is a
26
26
write-like invalidation operation: it does not read the target's value, and
27
-
refreshing a plain signal accessor is a no-op.
27
+
refreshing a plain signal accessor is a no-op that resolves immediately.
28
28
29
-
Use it to invalidate cached async values (e.g. force a re-fetch) without
30
-
tearing the consumer down.
29
+
The returned promise is safe to ignore (fire-and-forget refresh is
30
+
unchanged, and a failed refetch will not surface an unhandled rejection).
31
+
Awaiting it gives imperative flows the settle point without a reactive
32
+
read:
33
+
34
+
- Accessor targets resolve with the settled value; store targets resolve
35
+
with the store node passed (reads through it are fresh after the await).
36
+
- A failed re-ask rejects with the error (inside an action's generator,
37
+
`yield refresh(x)` throws back at the yield point and the action reverts
38
+
like any other failure).
39
+
- Semantics are quiescence, not flight identity: if another refresh (or
40
+
any invalidation) supersedes this one mid-flight, the promise waits for
41
+
— and delivers — whatever finally lands.
42
+
- Inside an action, truth landing into the held transaction is staged;
43
+
the promise still settles then (matching `resolve()`/`until()`, #2930)
44
+
and delivers the staged value — the caller's own optimistic override is
45
+
never the delivered value.
46
+
- The re-ask itself stays verdict-quiet exactly as before: `isPending`
47
+
does not flip for a bare refresh (pair with `affects()` for a visible
48
+
pending window).
31
49
32
50
## Import
33
51
@@ -38,14 +56,19 @@ import { refresh } from "solid-js";
38
56
## Type signature
39
57
40
58
```ts
41
-
function refresh<T>(target:Refreshable<T>):void;
59
+
function refresh<T>(
60
+
target:Refreshable<T>
61
+
):Promise<Textends (...args:any) =>inferV?V:T>;
42
62
```
43
63
44
64
## Examples
45
65
46
66
```ts
47
67
const user =createMemo(async () =>fetch(`/users/${id()}`).then(r=>r.json()));
0 commit comments