Simplifying Type Handling for API Responses in Effect Typescript Library
Hi,
I've created an Http Client with @effect/platform
and I've created some utility functions to make the api simpler and I'm consuming it like so:
However, this is bugging me because, first I need to declare two function that do the same thing, just the response validation is different, second, the return type of
Before I was using library
I was able to use a type helper to narrow down the return type based on
Is there a way to achieve the same thing with my new approach as with
I've created an Http Client with @effect/platform
and I've created some utility functions to make the api simpler and I'm consuming it like so:
However, this is bugging me because, first I need to declare two function that do the same thing, just the response validation is different, second, the return type of
getAllPermissionsGroups is Promise<PermissionGroupSelectSchema[]> | Promise<PermissionsGroupListSchema[]> And this is not very helpful.Before I was using library
ky and I could do this: I was able to use a type helper to narrow down the return type based on
viewIs there a way to achieve the same thing with my new approach as with
ky ?