PendingRpcRequest
Pending requests are the result of calling a supported method on a Rpc object. They encapsulate all of the information necessary to make the request without actually making it.
Calling the `send(options)` method on a
PendingRpcRequest<TResponse> will trigger the request and return a
promise for TResponse.
Calling the `reactiveStore()` method will return a
ReactiveActionStore compatible with useSyncExternalStore, Svelte stores, and other
reactive primitives. The store is returned in the idle state — call dispatch() to fire the
request.
Type Parameters
| Type Parameter |
|---|
TResponse |
Methods
reactiveStore()
Synchronously returns a ReactiveActionStore in the idle state, ready to dispatch
the underlying request. Compatible with useSyncExternalStore and other reactive primitives
that expect a { subscribe, getState } contract. Call dispatch() to fire the request
(again on retry), or reset() to abort the in-flight call and return to status: 'idle'.
Unlike PendingRpcRequest.send, this method does not fire the request on creation —
the caller is responsible for dispatching. This makes signal handling uniform: attach a
caller-provided cancellation source per dispatch via
store.withSignal(signal).dispatch(...).
Returns
ReactiveActionStore<[], TResponse>
Example
send()
Parameters
| Parameter | Type |
|---|---|
options? | Readonly<{ abortSignal?: AbortSignal; }> |
Returns
Promise<TResponse>