subscription tracked returns a 3-tuple to frontend instead of object
I am using
tracked
as per recommendation in https://trpc.io/docs/server/subscriptions#tracked like this:
It's properly typed on both frontend and backend, eg:
however what I actually receive on frontend is an 3-tuple [id, data, null].
I tried this both on versions "11.0.0-rc.666"
and next
and got the same results.Subscriptions | tRPC
Introduction
1 Reply
The current workaround to make both runtime and ts happy is to use
yield* tracked
instead of yield tracked
, which returns TrackedId | someObject
and then handle each case
but this is not optimal...