Theo's Typesafe CultTTC
Theo's Typesafe Cult12mo ago
1 reply
cyremur

tRPC streaming in mutations

tRPC supports streaming responses of useQuery using async generators, which I can use to yield return data to the frontend and get an updating list of stuff.

I want to implement the same return with a useMutation, but that one doesn't resolve the async generator into an array but passes it through to the frontend.

Does anyone know why these behave differently and how to work around this?
Was this page helpful?