Tilo
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Tilo on 4/19/2023 in #questions
Passing a object with readonly attributes through tRPC
I have a class (provided by a library)
I want to send this / the data of the readonly attributes to the client, but either while sending it directly or while destructing the object everything get's prefixed with and underscore (because it is private and readonly I think ?). The problem is if I try to access this data on the client Typescript will throw an error because the attribute is "private".
How can I clone this data and or send it so that I can access it on the client ?
9 replies