StreamingServerFnOptions
Options of an AsyncIterable server function; streaming excludes forms, batches and cached answers.
Options of an AsyncIterable server function; streaming excludes forms, batches and cached answers.
Import#
ts
import type { StreamingServerFnOptions } from "@shadow-js/dusk/server";
Signature#
ts
interface StreamingServerFnOptions
extends Omit<ServerFnOptions, "form" | "batch" | "singleFlight" | "cacheControl"> {
/** Opt in to typed SSE delivery through `rpc({ streams: {} })`. */
readonly stream: true;
/** Streaming answers cannot be consumed by progressive form posts. */
readonly form?: false;
/** A stream owns one request and cannot share a batch. */
readonly batch?: false;
/** Streaming answers cannot refresh page loaders. */
readonly singleFlight?: false;
/** A stream is always private and uncached. */
readonly cacheControl?: never;
}
Members#
| Name | Type | Description |
|---|---|---|
stream |
readonly stream: true |
Opt in to typed SSE delivery through rpc({ streams: {} }). |
form? |
readonly form?: false |
Streaming answers cannot be consumed by progressive form posts. |
batch? |
readonly batch?: false |
A stream owns one request and cannot share a batch. |
singleFlight? |
readonly singleFlight?: false |
Streaming answers cannot refresh page loaders. |
cacheControl? |
readonly cacheControl?: never |
A stream is always private and uncached. |