Resource & suspense

Guide: Resources & suspense.

Resource(T)

ExportSignature
createResource(comptime T, io, owner, ctx_ptr, fetcher) !*Resource(T)
createLocalResourcesame-thread variant
resourceReady(comptime T, owner, value) !*Resource(T) — pre-resolved
MethodNotes
get() ?Treactive; null while loading
peek() ResourceState(T).loading | .ready(T) | .err(anyerror)
resolve(io)await + apply staged result (main thread)
isLoading() / isReady() / isErr()predicates

Suspense

ExportSignature
suspense(ctx, SuspenseOpts{ .fallback: *Node, .id: ?[]const u8 }, ctx_ptr, comptime render_child) *Node
transitionalias of suspense
markSuspended() void — flips the nearest boundary to its fallback

Streaming

ExportPurpose
StreamRegistry / StreamSlottrack pending boundaries per response
withStreamRegistry(...)scope a registry over a render
Renderer.streamRender(...)chunked emission: shell first, resolved boundaries follow

Action

Action / createAction — client-mutation wrapper around a server function with pending state, the dual of Resource for writes.