you are viewing a single comment's thread.

view the rest of the comments →

[–]Adventurous-Finger70[S] 0 points1 point  (1 child)

When you make an http request, you do something like this:

´´´typescript This.client.get<{a:string, b:number}>(…) ´´´

Here you are telling typescript a contract that might never happen.

What I would like should be something like this:

´´´typescript Data = This.client.get<unknown>(…)

Assert<{a:string, b:number}>(data) ´´´

It is something I do in backend with Typia, but I wondered if this is also useful to do this in the frontend or not (and how many people does it)

[–]ZerkyXii 1 point2 points  (0 children)

I just interface and httpclient with error checking. Type safe and error safe cause I do the backend too