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 fire the
request and return a ReactiveActionStore compatible with useSyncExternalStore, Svelte
stores, and other reactive primitives.
Type Parameters
| Type Parameter |
|---|
TResponse |
Methods
reactiveStore()
Synchronously returns a ReactiveActionStore that fires the request on construction
and holds its lifecycle state. Compatible with useSyncExternalStore and other reactive
primitives that expect a { subscribe, getState } contract. Call dispatch() to re-fire the
request (for example after an error), or reset() to abort the in-flight call and return to
status: 'idle'.
Returns
ReactiveActionStore<[], TResponse>
Example
send()
Parameters
| Parameter | Type |
|---|---|
options? | Readonly<{ abortSignal?: AbortSignal; }> |
Returns
Promise<TResponse>