Skip to content

Commit

Permalink
add noStreaming option
Browse files Browse the repository at this point in the history
  • Loading branch information
codehz committed Jun 10, 2024
1 parent 23d02d4 commit bee95e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ export class StaticRouters {
if (error instanceof ClientOnlyError) return;
console.error(error, errorInfo);
},
noStreaming,
}: {
Shell: React.ComponentType<{ children: React.ReactElement }>;
preloadScript?: string;
bootstrapModules?: string[];
context?: T;
onError?(error: unknown, errorInfo: React.ErrorInfo): string | void;
noStreaming?: boolean;
}
): Promise<Response | null> {
const { pathname, search } = new URL(request.url);
Expand Down Expand Up @@ -108,6 +110,9 @@ export class StaticRouters {
onError,
}
);
if (noStreaming) {
await stream.allReady;
}
return new Response(stream, {
headers: {
"Content-Type": "text/html; charset=utf-8",
Expand Down

0 comments on commit bee95e7

Please sign in to comment.