Skip to content

Add async iterable stream client option#61

Draft
AlexanderKolberg wants to merge 1 commit into
masterfrom
async-iterable-stream-client
Draft

Add async iterable stream client option#61
AlexanderKolberg wants to merge 1 commit into
masterfrom
async-iterable-stream-client

Conversation

@AlexanderKolberg

Copy link
Copy Markdown
Member

Adds an opt-in -streamClient=asyncIterable mode for generated streaming methods. The default callback stream client stays the same.

With the new mode, stream methods return AsyncIterable<T>, so callers can use plain for await or hand the stream directly to things like TanStack Query streamedQuery without making the generated client depend on React Query.

I also added a small stream fixture and tests around chunk parsing, stream errors, and aborts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant